mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 09:40:37 +00:00
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.
This commit is contained in:
parent
79424411e7
commit
ae8d0cf3ac
1 changed files with 4 additions and 4 deletions
|
@ -3010,7 +3010,9 @@ gst_video_decoder_finish_frame (GstVideoDecoder * decoder,
|
||||||
goto done;
|
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);
|
GST_BUFFER_FLAG_UNSET (output_buffer, GST_BUFFER_FLAG_DELTA_UNIT);
|
||||||
|
|
||||||
|
@ -3040,9 +3042,7 @@ gst_video_decoder_finish_frame (GstVideoDecoder * decoder,
|
||||||
|
|
||||||
/* Get an additional ref to the buffer, which is going to be pushed
|
/* Get an additional ref to the buffer, which is going to be pushed
|
||||||
* downstream, the original ref is owned by the frame
|
* 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);
|
output_buffer = gst_buffer_ref (output_buffer);
|
||||||
|
|
||||||
/* Release frame so the buffer is writable when we push it downstream
|
/* Release frame so the buffer is writable when we push it downstream
|
||||||
|
|
Loading…
Reference in a new issue