From 4cd9dd39400f9c85108576db5e9808b4bc44d297 Mon Sep 17 00:00:00 2001 From: Link Mauve Date: Mon, 13 Nov 2023 12:01:03 +0000 Subject: [PATCH] v4l2codecs: Query the right buffer before expbuf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We were previously always querying index 0, and while the number of planes per buffer will never change, it seems more proper to query the right buffer rather than always the first one. This was found while reading strace logs, and wondering why the V4L2_BUF_FLAG_MAPPED flag was present on all ¬0 indices even though that happened before VIDIOC_EXPBUF. Part-of: --- subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2decoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2decoder.c b/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2decoder.c index b6deeff84a..a11cbdaf24 100644 --- a/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2decoder.c +++ b/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2decoder.c @@ -564,7 +564,7 @@ gst_v4l2_decoder_export_buffer (GstV4l2Decoder * self, gint i, ret; struct v4l2_plane planes[GST_VIDEO_MAX_PLANES] = { {0} }; struct v4l2_buffer v4l2_buf = { - .index = 0, + .index = index, .type = direction_to_buffer_type (self, direction), };