From: Leo Singer Date: Fri, 17 Dec 2010 04:38:31 +0000 (-0800) Subject: audioresample: push half a history length, instead of a full history length, at end... X-Git-Tag: 1.19.3~511^2~6555^2~1313 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d6d2aa44ab5c1cb1a0b83d07d3acf56a312d61a1;p=platform%2Fupstream%2Fgstreamer.git audioresample: push half a history length, instead of a full history length, at end-of-stream so that output segment and input segment have same duration --- diff --git a/gst/audioresample/gstaudioresample.c b/gst/audioresample/gstaudioresample.c index 8d0bddf..a9222a6 100644 --- a/gst/audioresample/gstaudioresample.c +++ b/gst/audioresample/gstaudioresample.c @@ -954,8 +954,10 @@ gst_audio_resample_event (GstBaseTransform * base, GstEvent * event) resample->need_discont = TRUE; break; case GST_EVENT_NEWSEGMENT: - if (resample->state) - gst_audio_resample_push_drain (resample, resample->num_nongap_samples); + if (resample->state) { + guint latency = resample->funcs->get_input_latency (resample->state); + gst_audio_resample_push_drain (resample, latency); + } gst_audio_resample_reset_state (resample); if (resample->state) resample->funcs->skip_zeros (resample->state); @@ -969,8 +971,10 @@ gst_audio_resample_event (GstBaseTransform * base, GstEvent * event) resample->need_discont = TRUE; break; case GST_EVENT_EOS: - if (resample->state) - gst_audio_resample_push_drain (resample, resample->num_nongap_samples); + if (resample->state) { + guint latency = resample->funcs->get_input_latency (resample->state); + gst_audio_resample_push_drain (resample, latency); + } gst_audio_resample_reset_state (resample); break; default: