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

This commit is contained in:
Leo Singer 2010-12-16 20:38:31 -08:00 committed by Sebastian Dröge
parent aac8b21678
commit d6d2aa44ab

View file

@ -954,8 +954,10 @@ gst_audio_resample_event (GstBaseTransform * base, GstEvent * event)
resample->need_discont = TRUE; resample->need_discont = TRUE;
break; break;
case GST_EVENT_NEWSEGMENT: case GST_EVENT_NEWSEGMENT:
if (resample->state) if (resample->state) {
gst_audio_resample_push_drain (resample, resample->num_nongap_samples); guint latency = resample->funcs->get_input_latency (resample->state);
gst_audio_resample_push_drain (resample, latency);
}
gst_audio_resample_reset_state (resample); gst_audio_resample_reset_state (resample);
if (resample->state) if (resample->state)
resample->funcs->skip_zeros (resample->state); resample->funcs->skip_zeros (resample->state);
@ -969,8 +971,10 @@ gst_audio_resample_event (GstBaseTransform * base, GstEvent * event)
resample->need_discont = TRUE; resample->need_discont = TRUE;
break; break;
case GST_EVENT_EOS: case GST_EVENT_EOS:
if (resample->state) if (resample->state) {
gst_audio_resample_push_drain (resample, resample->num_nongap_samples); guint latency = resample->funcs->get_input_latency (resample->state);
gst_audio_resample_push_drain (resample, latency);
}
gst_audio_resample_reset_state (resample); gst_audio_resample_reset_state (resample);
break; break;
default: default: