diff options
author | Arun Raghavan <arun@osg.samsung.com> | 2016-12-06 17:42:31 +0530 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2017-02-21 16:45:21 -0500 |
commit | d4afc3bc5be9b6b6d374af0b3dcbd6f8ff8a687d (patch) | |
tree | 7908f33eb35f34182ecc76e102e6fbea13244a31 | |
parent | 1f38e00be92589d03a3558b2fd2c6eecbf7ae535 (diff) | |
download | gstreamer-plugins-good-d4afc3bc5be9b6b6d374af0b3dcbd6f8ff8a687d.tar.gz |
v4l2object: Don't set empty interlace-mode list
If for some reason we fail to probe formats (all try_fmt calls fail, for
example), this is not a critical error, but we end up with an empty list
of interlace modes. This causes all subsequent negotiation to fail.
This patch fixes interlace-mode setting to be skipped if we failed to
detect any.
https://bugzilla.gnome.org/show_bug.cgi?id=775702
-rw-r--r-- | sys/v4l2/gstv4l2object.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index fb87744a1..3a24a0eb0 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -2172,7 +2172,12 @@ gst_v4l2_object_add_interlace_mode (GstV4l2Object * v4l2object, } gst_v4l2src_value_simplify (&interlace_formats); - gst_structure_take_value (s, "interlace-mode", &interlace_formats); + + if (gst_value_list_get_size (&interlace_formats) > 0) + gst_structure_take_value (s, "interlace-mode", &interlace_formats); + else + GST_WARNING_OBJECT (v4l2object, "Failed to determine interlace mode"); + return; } |