mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 15:51:11 +00:00
audiobuffersplit: Use input running time for comparison instead of the currently tracked running time
Otherwise gapless mode would do completely wrong calculations on discontinuities and cause input/output to drift slowly. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2780>
This commit is contained in:
parent
0485c354d2
commit
fad0a72eca
1 changed files with 3 additions and 3 deletions
|
@ -549,14 +549,14 @@ gst_audio_buffer_split_handle_discont (GstAudioBufferSplit * self,
|
|||
GST_TIME_ARGS (current_rt_end), GST_TIME_ARGS (input_rt));
|
||||
|
||||
new_offset =
|
||||
gst_util_uint64_scale (current_rt - self->resync_rt,
|
||||
gst_util_uint64_scale (input_rt - self->resync_rt,
|
||||
rate * ABS (self->in_segment.rate), GST_SECOND);
|
||||
if (current_rt < self->resync_rt) {
|
||||
if (input_rt < self->resync_rt) {
|
||||
guint64 drop_samples;
|
||||
|
||||
new_offset =
|
||||
gst_util_uint64_scale (self->resync_rt -
|
||||
current_rt, rate * ABS (self->in_segment.rate), GST_SECOND);
|
||||
input_rt, rate * ABS (self->in_segment.rate), GST_SECOND);
|
||||
drop_samples = self->current_offset + avail_samples + new_offset;
|
||||
|
||||
GST_DEBUG_OBJECT (self,
|
||||
|
|
Loading…
Reference in a new issue