audiobuffersplit: Unset DISCONT flag if not discontinuous
authorSebastian Dröge <sebastian@centricular.com>
Mon, 25 May 2020 12:36:38 +0000 (15:36 +0300)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 25 May 2020 12:41:32 +0000 (12:41 +0000)
commitbd67ef18e9ae3b122e491d28b396a62fa75565fd
tree272da79feb8d54a433a7b1df64c71542bb99aacd
parent3efc8f5de9e9ac8e385b77067912f25c74fb3de6
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>
gst/audiobuffersplit/gstaudiobuffersplit.c