From 582f91366781117d6554e8df2ba06432d29e8bec Mon Sep 17 00:00:00 2001 From: Julien Isorce Date: Tue, 31 Dec 2013 15:37:26 +0000 Subject: [PATCH] v4l2object: set only one plane for encoded format https://bugzilla.gnome.org/show_bug.cgi?id=720568 --- sys/v4l2/gstv4l2object.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index 08fca5d..df49e09 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -2571,11 +2571,11 @@ gst_v4l2_object_set_format (GstV4l2Object * v4l2object, GstCaps * caps) format.fmt.pix_mp.field != field) { /* even in v4l2 multiplanar mode we can work in contiguous mode * if the device supports it */ - gint n_v4l_planes; + gint n_v4l_planes = GST_VIDEO_INFO_N_PLANES (&info); - if (v4l2object->prefered_non_contiguous) - n_v4l_planes = GST_VIDEO_INFO_N_PLANES (&info); - else + /* if encoded format (GST_VIDEO_INFO_N_PLANES return 0) + * or if contiguous is prefered */ + if (!n_v4l_planes || !v4l2object->prefered_non_contiguous) n_v4l_planes = 1; /* something different, set the format */ -- 2.7.4