From 0a7d4afc1bbda9d1d8fca51e3a68dc84ed998c71 Mon Sep 17 00:00:00 2001 From: Diogo Carbonera Luvizon Date: Mon, 1 Oct 2012 09:29:21 -0300 Subject: [PATCH] v4l2: save the format correctly If TRY_FMT is not implemented, gst_v4l2_object_get_nearest_size will use S_FMT and will change the device's operation mode. To save the old device mode we need to set the type field or else it will fail to save the previous format. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=685209 --- sys/v4l2/gstv4l2object.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index 81654e20a1..5f59409689 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -2054,6 +2054,7 @@ gst_v4l2_object_get_nearest_size (GstV4l2Object * v4l2object, /* Some drivers are buggy and will modify the currently set format when processing VIDIOC_TRY_FMT, so we remember what is set at the minute, and will reset it when done. */ + prevfmt.type = v4l2object->type; prevfmt_valid = (v4l2_ioctl (fd, VIDIOC_G_FMT, &prevfmt) >= 0); /* get size delimiters */