winegstreamer: Do not allow timestamp + late to go negative in QOS messages.

This commit is contained in:
Maarten Lankhorst 2010-11-24 18:23:56 +01:00 committed by Alexandre Julliard
parent f63950d023
commit 3213061ebd
2 changed files with 8 additions and 2 deletions

View File

@ -1387,7 +1387,10 @@ static const IMediaSeekingVtbl GST_Seeking_Vtbl =
static HRESULT WINAPI GST_QualityControl_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm) {
QualityControlImpl *This = (QualityControlImpl*)iface;
GSTOutPin *pin = (GSTOutPin*)This->self;
gst_pad_push_event(pin->my_sink, gst_event_new_qos(1000./qm.Proportion, qm.Late*100, qm.TimeStamp*100));
REFERENCE_TIME late = qm.Late;
if (qm.Late < 0 && -qm.Late > qm.TimeStamp)
late = -qm.TimeStamp;
gst_pad_push_event(pin->my_sink, gst_event_new_qos(1000./qm.Proportion, late*100, qm.TimeStamp*100));
return S_OK;
}

View File

@ -437,7 +437,10 @@ static HRESULT WINAPI Gstreamer_transform_NewSegment(TransformFilter *iface, REF
static HRESULT WINAPI Gstreamer_transform_QOS(TransformFilter *iface, IBaseFilter *sender, Quality qm) {
GstTfImpl *This = (GstTfImpl*)iface;
gst_pad_push_event(This->my_sink, gst_event_new_qos(1000. / qm.Proportion, qm.Late * 100, qm.TimeStamp * 100));
REFERENCE_TIME late = qm.Late;
if (qm.Late < 0 && -qm.Late > qm.TimeStamp)
late = -qm.TimeStamp;
gst_pad_push_event(This->my_sink, gst_event_new_qos(1000. / qm.Proportion, late * 100, qm.TimeStamp * 100));
return QualityControlImpl_Notify((IQualityControl*)&iface->qcimpl, sender, qm);
}