diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2020-12-15 15:07:31 +0200 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2020-12-15 17:59:49 +0000 |
commit | 98a3329b70fb06da73b1194bf86f770a153ffe66 (patch) | |
tree | 844b496bb02e0531fb77a6c5e0ffe7be950a81ff | |
parent | a26d82ba24fac727e9c18910b04b6773488881c6 (diff) | |
download | gstreamer-plugins-base-98a3329b70fb06da73b1194bf86f770a153ffe66.tar.gz |
audiorate: Make buffer writable before changing its metadata
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/978>
-rw-r--r-- | gst/audiorate/gstaudiorate.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gst/audiorate/gstaudiorate.c b/gst/audiorate/gstaudiorate.c index 30a5d6ffd..0af5c127e 100644 --- a/gst/audiorate/gstaudiorate.c +++ b/gst/audiorate/gstaudiorate.c @@ -647,6 +647,8 @@ send: if (gst_buffer_get_size (buf) == 0) goto beach; + buf = gst_buffer_make_writable (buf); + /* Now calculate parameters for whichever buffer (either the original * or truncated one) we're pushing. */ GST_BUFFER_OFFSET (buf) = audiorate->next_offset; @@ -660,14 +662,12 @@ send: if (audiorate->discont) { /* we need to output a discont buffer, do so now */ GST_DEBUG_OBJECT (audiorate, "marking DISCONT on output buffer"); - buf = gst_buffer_make_writable (buf); GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT); audiorate->discont = FALSE; } else if (GST_BUFFER_IS_DISCONT (buf)) { /* else we make everything continuous so we can safely remove the DISCONT * flag from the buffer if there was one */ GST_DEBUG_OBJECT (audiorate, "removing DISCONT from buffer"); - buf = gst_buffer_make_writable (buf); GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_FLAG_DISCONT); } |