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: 105d232fde ("v4l2bufferpool: queue back the buffer flagged LAST but empty")
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7479>
This commit is contained in:
Randy Li (ayaka) 2024-09-09 11:23:53 -04:00 committed by GStreamer Marge Bot
parent dcfc66a1ac
commit 6f5bbd0276

View file

@ -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;
}