mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 19:20:35 +00:00
audiobuffersplit: Keep track of resync time separately
If we drain after a discont, the discont time given by the stream synchronizer is already the time after the discontinuity. But we need to drain all pending data based on the previous discont time instead.
This commit is contained in:
parent
186870d10a
commit
b2602a459b
2 changed files with 3 additions and 5 deletions
|
@ -328,11 +328,7 @@ gst_audio_buffer_split_output (GstAudioBufferSplit * self, gboolean force,
|
|||
GstFlowReturn ret = GST_FLOW_OK;
|
||||
GstClockTime resync_time;
|
||||
|
||||
GST_OBJECT_LOCK (self);
|
||||
resync_time =
|
||||
gst_audio_stream_align_get_timestamp_at_discont (self->stream_align);
|
||||
GST_OBJECT_UNLOCK (self);
|
||||
|
||||
resync_time = self->resync_time;
|
||||
size = samples_per_buffer * bpf;
|
||||
|
||||
/* If we accumulated enough error for one sample, include one
|
||||
|
@ -425,6 +421,7 @@ gst_audio_buffer_split_handle_discont (GstAudioBufferSplit * self,
|
|||
|
||||
self->current_offset = 0;
|
||||
self->accumulated_error = 0;
|
||||
self->resync_time = GST_BUFFER_PTS (buffer);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -53,6 +53,7 @@ struct _GstAudioBufferSplit {
|
|||
GstAdapter *adapter;
|
||||
|
||||
GstAudioStreamAlign *stream_align;
|
||||
GstClockTime resync_time;
|
||||
guint64 current_offset; /* offset from start time in samples */
|
||||
|
||||
guint samples_per_buffer;
|
||||
|
|
Loading…
Reference in a new issue