v4l2codecs: Query the right buffer before expbuf

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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5647>
This commit is contained in:
Link Mauve 2023-11-13 12:01:03 +00:00 committed by GStreamer Marge Bot
parent 2d663880af
commit 4cd9dd3940

View file

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