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:
parent
2171c5d27e
commit
8162b4ec86
@ -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 ();
|
||||
|
Loading…
x
Reference in New Issue
Block a user