[PATCH] winegstreamer: Make sure size is set correctly before delivering buffers

Maarten Lankhorst m.b.lankhorst at gmail.com
Fri Dec 3 09:06:43 CST 2010


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

diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index 270c93a..ba96789 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -533,10 +533,10 @@ static GstFlowReturn got_data_sink(GstPad *pad, GstBuffer *buf) {
             return GST_FLOW_WRONG_STATE;
         }
         FIXME("Did not get a GST_APP_BUFFER, creating a sample\n");
-        IMediaSample_SetActualDataLength(sample, GST_BUFFER_SIZE(buf));
         IMediaSample_GetPointer(sample, &ptr);
         memcpy(ptr, GST_BUFFER_DATA(buf), GST_BUFFER_SIZE(buf));
     }
+    IMediaSample_SetActualDataLength(sample, GST_BUFFER_SIZE(buf));
 
     if (GST_BUFFER_TIMESTAMP_IS_VALID(buf)) {
         REFERENCE_TIME rtStart = gst_segment_to_running_time(pin->segment, GST_FORMAT_TIME, buf->timestamp);
diff --git a/dlls/winegstreamer/gsttffilter.c b/dlls/winegstreamer/gsttffilter.c
index eddd1e8..88dc8b8 100644
--- a/dlls/winegstreamer/gsttffilter.c
+++ b/dlls/winegstreamer/gsttffilter.c
@@ -180,6 +180,7 @@ static GstFlowReturn got_data(GstPad *pad, GstBuffer *buf) {
     IMediaSample_SetDiscontinuity(sample, GST_BUFFER_FLAG_IS_SET(buf, GST_BUFFER_FLAG_DISCONT));
     IMediaSample_SetPreroll(sample, GST_BUFFER_FLAG_IS_SET(buf, GST_BUFFER_FLAG_PREROLL));
     IMediaSample_SetSyncPoint(sample, !GST_BUFFER_FLAG_IS_SET(buf, GST_BUFFER_FLAG_DELTA_UNIT));
+    IMediaSample_SetActualDataLength(sample, GST_BUFFER_SIZE(buf));
 
     hr = BaseOutputPinImpl_Deliver((BaseOutputPin*)This->tf.ppPins[1], sample);
     gst_buffer_unref(buf);
-- 
1.7.1




More information about the wine-patches mailing list