diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2020-03-03 21:22:52 -0500 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2020-03-31 09:34:05 -0400 |
commit | b47929a74d54c0037084bad6e2387bb3e842fcf0 (patch) | |
tree | 4f26c75865cbaf789312e81048d8a5bb7c99432d /sys/v4l2codecs | |
parent | b107c20198ebebf172a653f55948ff6d1993e931 (diff) | |
download | gstreamer-plugins-bad-b47929a74d54c0037084bad6e2387bb3e842fcf0.tar.gz |
v4l2slh264dec: Hold on picture buffers
These buffers should not be reused for decoding until they are no longer
referenced.
Diffstat (limited to 'sys/v4l2codecs')
-rw-r--r-- | sys/v4l2codecs/gstv4l2codech264dec.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/v4l2codecs/gstv4l2codech264dec.c b/sys/v4l2codecs/gstv4l2codech264dec.c index 70660b3ab..24922e86b 100644 --- a/sys/v4l2codecs/gstv4l2codech264dec.c +++ b/sys/v4l2codecs/gstv4l2codech264dec.c @@ -548,10 +548,12 @@ finish_frame: gst_v4l2_request_set_done (request); frame = gst_video_decoder_get_frame (GST_VIDEO_DECODER (self), picture->system_frame_number); - g_return_val_if_fail (frame, GST_FLOW_ERROR); + g_return_val_if_fail (frame->output_buffer, GST_FLOW_ERROR); - gst_h264_picture_set_user_data (picture, NULL, NULL); + /* Hold on reference buffers for the rest of the picture lifetime */ + gst_h264_picture_set_user_data (picture, + gst_buffer_ref (frame->output_buffer), (GDestroyNotify) gst_buffer_unref); return gst_video_decoder_finish_frame (GST_VIDEO_DECODER (self), frame); } |