From 24eda30bd7bed0500b20ea87d1f1f11e4271c658 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Tue, 6 Apr 2021 16:24:39 -0400 Subject: [PATCH] v4l2codecs: Fix holding of reference picture buffer The picture buffer (V4L2 CAPTURE buffer) was being released immediatly when the request was done. This was problematic since even after the request is done, the picture buffer might still be used as a reference and should not be reused for further decoding yet. This change effectively bind the picture buffer lifetime to the request. So that if the picture is never showned (decode only frame) or the request queue is full before the buffer is displayed, the picture buffer will remain alive. Part-of: --- sys/v4l2codecs/gstv4l2decoder.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/v4l2codecs/gstv4l2decoder.c b/sys/v4l2codecs/gstv4l2decoder.c index 10b8cf2..b5f585d 100644 --- a/sys/v4l2codecs/gstv4l2decoder.c +++ b/sys/v4l2codecs/gstv4l2decoder.c @@ -1124,7 +1124,6 @@ gst_v4l2_request_set_done (GstV4l2Request * request) } } - g_clear_pointer (&pending_req->pic_buf, gst_buffer_unref); pending_req->pending = FALSE; gst_v4l2_request_unref (pending_req); -- 2.7.4