mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-04 16:39:39 +00:00
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:
parent
aac8b21678
commit
d6d2aa44ab
1 changed files with 8 additions and 4 deletions
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue