From 6f5bbd027612e8b1891b3bb313e295c751b5b4f4 Mon Sep 17 00:00:00 2001 From: "Randy Li (ayaka)" Date: Mon, 9 Sep 2024 11:23:53 -0400 Subject: [PATCH] v4l2bufferpool: actually queue back the empty buffer flagged LAST The buffer would fail at gst_v4l2_is_buffer_valid() before, since it has a reference on it, it is not writable. Fixes: 105d232fdec1 ("v4l2bufferpool: queue back the buffer flagged LAST but empty") Part-of: --- subprojects/gst-plugins-good/sys/v4l2/gstv4l2bufferpool.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2bufferpool.c b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2bufferpool.c index 67036dcdd4..f422ce7a47 100644 --- a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2bufferpool.c +++ b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2bufferpool.c @@ -1296,10 +1296,8 @@ gst_v4l2_buffer_pool_dqbuf (GstV4l2BufferPool * pool, GstBuffer ** buffer, if (group->buffer.flags & V4L2_BUF_FLAG_LAST && group->planes[0].bytesused == 0) { GST_DEBUG_OBJECT (pool, "Empty last buffer, signalling eos."); - *buffer = outbuf; - outbuf = NULL; - gst_buffer_ref (*buffer); - gst_v4l2_buffer_pool_complete_release_buffer (bpool, *buffer, FALSE); + gst_v4l2_buffer_pool_complete_release_buffer (bpool, outbuf, FALSE); + *buffer = NULL; goto eos; }