mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
audiobuffersplit: Unset DISCONT flag if not discontinuous
And also set/unset the RESYNC flag accordingly. It can happen that the flag is preserved by GstAdapter from the input buffer. For example if a big input buffer is split into many small ones, each of the small ones would have the flag set. All other buffer flags seem safe to keep here if they were set, including the GAP flag. Also ensure that the buffer is actually writable before changing any flags or metadata on it. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1298>
This commit is contained in:
parent
3efc8f5de9
commit
bd67ef18e9
1 changed files with 6 additions and 1 deletions
|
@ -379,10 +379,15 @@ gst_audio_buffer_split_output (GstAudioBufferSplit * self, gboolean force,
|
|||
|
||||
size = MIN (size, avail);
|
||||
buffer = gst_adapter_take_buffer (self->adapter, size);
|
||||
buffer = gst_buffer_make_writable (buffer);
|
||||
|
||||
/* After a reset we have to set the discont flag */
|
||||
if (self->current_offset == 0)
|
||||
GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DISCONT);
|
||||
GST_BUFFER_FLAG_SET (buffer,
|
||||
GST_BUFFER_FLAG_DISCONT | GST_BUFFER_FLAG_RESYNC);
|
||||
else
|
||||
GST_BUFFER_FLAG_UNSET (buffer,
|
||||
GST_BUFFER_FLAG_DISCONT | GST_BUFFER_FLAG_RESYNC);
|
||||
|
||||
resync_time_diff =
|
||||
gst_util_uint64_scale (self->current_offset, GST_SECOND, rate);
|
||||
|
|
Loading…
Reference in a new issue