[PATCH 4/4] winegstreamer: Do not allow timestamp + late to go negative in QOS messages

Maarten Lankhorst m.b.lankhorst at gmail.com
Wed Nov 24 11:23:56 CST 2010


---
 dlls/winegstreamer/gstdemux.c    |    5 ++++-
 dlls/winegstreamer/gsttffilter.c |    5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index 67e364b..ae50a15 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -1385,7 +1385,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;
 }
 
diff --git a/dlls/winegstreamer/gsttffilter.c b/dlls/winegstreamer/gsttffilter.c
index 912439e..b85ab43 100644
--- a/dlls/winegstreamer/gsttffilter.c
+++ b/dlls/winegstreamer/gsttffilter.c
@@ -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);
 }
 
-- 
1.7.1




More information about the wine-patches mailing list