From: Mark Nauwelaerts Date: Thu, 22 Jul 2010 09:46:35 +0000 (+0200) Subject: avidemux: push mode; handle 0-size data chunks X-Git-Tag: RELEASE-0.10.25~53 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f62c6ce5c8d03b5645a4945ca95da2be3431e83e;p=platform%2Fupstream%2Fgst-plugins-good.git avidemux: push mode; handle 0-size data chunks Fixes #618535. --- diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c index a62afb9..389649a 100644 --- a/gst/avi/gstavidemux.c +++ b/gst/avi/gstavidemux.c @@ -4873,9 +4873,13 @@ gst_avi_demux_stream_data (GstAviDemux * avi) * through the whole file */ if (avi->abort_buffering) { avi->abort_buffering = FALSE; - gst_adapter_flush (avi->adapter, 8); + if (size) { + gst_adapter_flush (avi->adapter, 8); + return GST_FLOW_OK; + } + } else { + return GST_FLOW_OK; } - return GST_FLOW_OK; } GST_DEBUG ("chunk ID %" GST_FOURCC_FORMAT ", size %u", GST_FOURCC_ARGS (tag), size); @@ -4904,9 +4908,13 @@ gst_avi_demux_stream_data (GstAviDemux * avi) if (saw_desired_kf) { gst_adapter_flush (avi->adapter, 8); /* get buffer */ - buf = gst_adapter_take_buffer (avi->adapter, GST_ROUND_UP_2 (size)); - /* patch the size */ - GST_BUFFER_SIZE (buf) = size; + if (size) { + buf = gst_adapter_take_buffer (avi->adapter, GST_ROUND_UP_2 (size)); + /* patch the size */ + GST_BUFFER_SIZE (buf) = size; + } else { + buf = NULL; + } } else { GST_DEBUG_OBJECT (avi, "Desired keyframe not yet reached, flushing chunk"); @@ -4980,6 +4988,7 @@ gst_avi_demux_stream_data (GstAviDemux * avi) stream->discont = FALSE; } res = gst_pad_push (stream->pad, buf); + buf = NULL; /* combine flows */ res = gst_avi_demux_combine_flows (avi, stream, res);