mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
baseparse: Add missing gst_buffer_make_writable
When the subclass attempts to finish without an explicit `out_buffer`, we take a buffer from our adapter. We need to make this buffer writable before copying the metadata. This led to data races such as in the following pipeline, which randomly messed up the buffer PTS: gst-launch-1.0 -e audiotestsrc timestamp-offset=5555 num-buffers=100 \ ! opusenc ! tee name=t ! queue ! opusparse ! fakesink silent=0 \ t. ! queue ! opusparse ! fakesink silent=0 -v | grep '0000, dur' Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5720>
This commit is contained in:
parent
36f653fdc5
commit
a2533d2556
1 changed files with 1 additions and 0 deletions
|
@ -2728,6 +2728,7 @@ gst_base_parse_finish_frame (GstBaseParse * parse, GstBaseParseFrame * frame,
|
|||
GstBuffer *src, *dest;
|
||||
|
||||
frame->out_buffer = gst_adapter_take_buffer (parse->priv->adapter, size);
|
||||
frame->out_buffer = gst_buffer_make_writable (frame->out_buffer);
|
||||
dest = frame->out_buffer;
|
||||
src = frame->buffer;
|
||||
GST_BUFFER_PTS (dest) = GST_BUFFER_PTS (src);
|
||||
|
|
Loading…
Reference in a new issue