summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2017-07-24 16:48:17 +0300
committerSebastian Dröge <sebastian@centricular.com>2017-08-11 10:58:47 +0300
commit9e7e1d50b2879e838b5ad3fa6ebf18c4458c9f1b (patch)
tree094d8554f697c19731e8d6584bde55006d4dd8b8
parente5a9d10e95f6c479462486d75a3c484d568244b5 (diff)
downloadgstreamer-plugins-base-9e7e1d50b2879e838b5ad3fa6ebf18c4458c9f1b.tar.gz
videodecoder: Make sure we have an actually writable buffer when modifying metadata
avviddec keeps references to the buffers internally for example, in which case we need to do a shallow copy of the buffer.
-rw-r--r--gst-libs/gst/video/gstvideodecoder.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gst-libs/gst/video/gstvideodecoder.c b/gst-libs/gst/video/gstvideodecoder.c
index b91a32e79..c557490e7 100644
--- a/gst-libs/gst/video/gstvideodecoder.c
+++ b/gst-libs/gst/video/gstvideodecoder.c
@@ -3006,7 +3006,9 @@ gst_video_decoder_finish_frame (GstVideoDecoder * decoder,
goto done;
}
- output_buffer = frame->output_buffer;
+ /* We need a writable buffer for the metadata changes below */
+ output_buffer = frame->output_buffer =
+ gst_buffer_make_writable (frame->output_buffer);
GST_BUFFER_FLAG_UNSET (output_buffer, GST_BUFFER_FLAG_DELTA_UNIT);
@@ -3036,9 +3038,7 @@ gst_video_decoder_finish_frame (GstVideoDecoder * decoder,
/* Get an additional ref to the buffer, which is going to be pushed
* downstream, the original ref is owned by the frame
- *
- * FIXME: clip_and_push_buf() changes buffer metadata but the buffer
- * might have a refcount > 1 */
+ */
output_buffer = gst_buffer_ref (output_buffer);
/* Release frame so the buffer is writable when we push it downstream