winegstreamer: Make sure size is set correctly before delivering buffers.

This commit is contained in:
Maarten Lankhorst 2010-12-03 16:06:43 +01:00 committed by Alexandre Julliard
parent 4416ef9de6
commit c911893e43
2 changed files with 2 additions and 1 deletions

View File

@ -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);

View File

@ -178,6 +178,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);