diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2018-08-17 16:33:52 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2018-08-17 16:40:16 +0300 |
commit | b2602a459bba43f103872a072b5ee91685e70c71 (patch) | |
tree | 62b6a28f1a19e927f831c93feab3e7f0aa46f0ed /gst | |
parent | 186870d10ad58c2dc95f5f50a16f29bc1f47bd51 (diff) | |
download | gstreamer-plugins-bad-b2602a459bba43f103872a072b5ee91685e70c71.tar.gz |
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.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/audiobuffersplit/gstaudiobuffersplit.c | 7 | ||||
-rw-r--r-- | gst/audiobuffersplit/gstaudiobuffersplit.h | 1 |
2 files changed, 3 insertions, 5 deletions
diff --git a/gst/audiobuffersplit/gstaudiobuffersplit.c b/gst/audiobuffersplit/gstaudiobuffersplit.c index d73e391da..225fb9b7b 100644 --- a/gst/audiobuffersplit/gstaudiobuffersplit.c +++ b/gst/audiobuffersplit/gstaudiobuffersplit.c @@ -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; diff --git a/gst/audiobuffersplit/gstaudiobuffersplit.h b/gst/audiobuffersplit/gstaudiobuffersplit.h index 10bbdc80d..ae24b8fff 100644 --- a/gst/audiobuffersplit/gstaudiobuffersplit.h +++ b/gst/audiobuffersplit/gstaudiobuffersplit.h @@ -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; |