From: Kipp Cannon Date: Mon, 28 Nov 2011 16:59:32 +0000 (+0100) Subject: audioresample: Don't emit DISCONT buffers if no discontinuity happened X-Git-Tag: 1.19.3~511^2~6555^2~286 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4c52f4e625f910d6fba34d49fe06cfd1220c9c93;p=platform%2Fupstream%2Fgstreamer.git audioresample: Don't emit DISCONT buffers if no discontinuity happened audioresample is derived from GstBaseTransform, and one of GstBaseTransform's traits is that if the derived element does not produce an output buffer from some input buffer then the first output buffer after that gets flaged as a discontinuity, whether or not the buffer actually is discontinuous from the output buffer that preceded it. When downsampling, the audioresample element requires more than one input sample for each output sample, and if the ratio of input to output sample rates is high enough and the input buffers short enough it can come to pass that the resampler does not receive enough samples on its input to produce any output. Currently the resampler returns GST_BASE_TRANSFORM_FLOW_DROPPED from the transform() method in this case, causing the next buffer to be flagged as a discontinuity. If subsequent elements in the pipeline reset themselves on disconts, this can cause clicks and other undesireable behaviour. Fixes bug #665004. --- diff --git a/gst/audioresample/gstaudioresample.c b/gst/audioresample/gstaudioresample.c index 7c48882..80988cb 100644 --- a/gst/audioresample/gstaudioresample.c +++ b/gst/audioresample/gstaudioresample.c @@ -1168,10 +1168,6 @@ gst_audio_resample_process (GstAudioResample * resample, GstBuffer * inbuf, GST_TIME_ARGS (GST_BUFFER_DURATION (outbuf)), GST_BUFFER_OFFSET (outbuf), GST_BUFFER_OFFSET_END (outbuf)); - if (out_processed == 0) { - GST_DEBUG_OBJECT (resample, "buffer dropped"); - return GST_BASE_TRANSFORM_FLOW_DROPPED; - } return GST_FLOW_OK; }