mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-03 01:02:19 +00:00
audiorate: Make buffer writable before changing its metadata
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/977>
This commit is contained in:
parent
d86cf6314f
commit
dcea0b3999
1 changed files with 2 additions and 2 deletions
|
@ -647,6 +647,8 @@ send:
|
||||||
if (gst_buffer_get_size (buf) == 0)
|
if (gst_buffer_get_size (buf) == 0)
|
||||||
goto beach;
|
goto beach;
|
||||||
|
|
||||||
|
buf = gst_buffer_make_writable (buf);
|
||||||
|
|
||||||
/* Now calculate parameters for whichever buffer (either the original
|
/* Now calculate parameters for whichever buffer (either the original
|
||||||
* or truncated one) we're pushing. */
|
* or truncated one) we're pushing. */
|
||||||
GST_BUFFER_OFFSET (buf) = audiorate->next_offset;
|
GST_BUFFER_OFFSET (buf) = audiorate->next_offset;
|
||||||
|
@ -660,14 +662,12 @@ send:
|
||||||
if (audiorate->discont) {
|
if (audiorate->discont) {
|
||||||
/* we need to output a discont buffer, do so now */
|
/* we need to output a discont buffer, do so now */
|
||||||
GST_DEBUG_OBJECT (audiorate, "marking DISCONT on output buffer");
|
GST_DEBUG_OBJECT (audiorate, "marking DISCONT on output buffer");
|
||||||
buf = gst_buffer_make_writable (buf);
|
|
||||||
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT);
|
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT);
|
||||||
audiorate->discont = FALSE;
|
audiorate->discont = FALSE;
|
||||||
} else if (GST_BUFFER_IS_DISCONT (buf)) {
|
} else if (GST_BUFFER_IS_DISCONT (buf)) {
|
||||||
/* else we make everything continuous so we can safely remove the DISCONT
|
/* else we make everything continuous so we can safely remove the DISCONT
|
||||||
* flag from the buffer if there was one */
|
* flag from the buffer if there was one */
|
||||||
GST_DEBUG_OBJECT (audiorate, "removing DISCONT from buffer");
|
GST_DEBUG_OBJECT (audiorate, "removing DISCONT from buffer");
|
||||||
buf = gst_buffer_make_writable (buf);
|
|
||||||
GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_FLAG_DISCONT);
|
GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_FLAG_DISCONT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue