mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 10:41:04 +00:00
audioresample: Drain resampler on discontinuities
Otherwise we would lose the last few samples when resetting the resampler. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/670>
This commit is contained in:
parent
bf0cffc474
commit
44cd1c7a65
1 changed files with 5 additions and 0 deletions
|
@ -871,6 +871,11 @@ gst_audio_resample_transform (GstBaseTransform * base, GstBuffer * inbuf,
|
||||||
* flag to resync timestamp and offset counters and send event
|
* flag to resync timestamp and offset counters and send event
|
||||||
* downstream */
|
* downstream */
|
||||||
if (G_UNLIKELY (gst_audio_resample_check_discont (resample, inbuf))) {
|
if (G_UNLIKELY (gst_audio_resample_check_discont (resample, inbuf))) {
|
||||||
|
if (resample->converter) {
|
||||||
|
gsize latency = gst_audio_converter_get_max_latency (resample->converter);
|
||||||
|
gst_audio_resample_push_drain (resample, latency);
|
||||||
|
}
|
||||||
|
|
||||||
gst_audio_resample_reset_state (resample);
|
gst_audio_resample_reset_state (resample);
|
||||||
resample->need_discont = TRUE;
|
resample->need_discont = TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue