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:
Sebastian Dröge 2020-05-26 22:51:06 +03:00 committed by GStreamer Merge Bot
parent bf0cffc474
commit 44cd1c7a65

View file

@ -871,6 +871,11 @@ gst_audio_resample_transform (GstBaseTransform * base, GstBuffer * inbuf,
* flag to resync timestamp and offset counters and send event
* downstream */
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);
resample->need_discont = TRUE;
}