audiorate: Take the tolerance into account when filling gaps

The property is defined as:

> The difference between incoming timestamp and next timestamp must exceed
> the given value for audiorate to add or drop samples.

so if the gap duration < tolerance, we should not act.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8498>
This commit is contained in:
Thibault Saunier 2025-02-14 13:04:27 -03:00 committed by GStreamer Marge Bot
parent 2171c5d27e
commit 8162b4ec86

View File

@ -285,6 +285,12 @@ gst_audio_rate_fill_to_time (GstAudioRate * audiorate, GstClockTime time)
!GST_CLOCK_TIME_IS_VALID (audiorate->next_ts))
return;
if (ABS (GST_CLOCK_DIFF (time, audiorate->next_ts)) <= audiorate->tolerance) {
GST_DEBUG_OBJECT (audiorate,
"Not filling gap as its duration < tolerance ( %" GST_TIMEP_FORMAT " )",
&audiorate->tolerance);
}
/* feed an empty buffer to chain with the given timestamp,
* it will take care of filling */
buf = gst_buffer_new ();