diff options
author | Víctor Manuel Jáquez Leal <vjaquez@igalia.com> | 2016-12-14 19:15:03 +0100 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2017-02-21 16:45:56 -0500 |
commit | 4a57ff75449e1ba525df28c8b99ff9fd566430a3 (patch) | |
tree | b21c3f284adeb392ae0303fb02918b1833621809 | |
parent | d4afc3bc5be9b6b6d374af0b3dcbd6f8ff8a687d (diff) | |
download | gstreamer-plugins-good-4a57ff75449e1ba525df28c8b99ff9fd566430a3.tar.gz |
v4l2object: Don't check size in a non-list value
After commit 1ea9735a I see these error while using the webcam
integrated in my laptop:
GStreamer-CRITICAL **: gst_value_list_get_size: assertion 'GST_VALUE_HOLDS_LIST (value)' failed
The issue is gst_v4l2src_value_simplify() was doing its job of
generating a single value, rather than the original list. That why,
when getting the list size, a critical warning was raised.
This patch takes advantage of the compiler optimizations to verify
first if the list was simplified, thus use it directly, otherwise,
if it is a list, verify its size.
https://bugzilla.gnome.org/show_bug.cgi?id=776106
-rw-r--r-- | sys/v4l2/gstv4l2object.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index 3a24a0eb0..fa17ffa9e 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -2171,9 +2171,8 @@ gst_v4l2_object_add_interlace_mode (GstV4l2Object * v4l2object, gst_value_list_append_and_take_value (&interlace_formats, &interlace_enum); } - gst_v4l2src_value_simplify (&interlace_formats); - - if (gst_value_list_get_size (&interlace_formats) > 0) + if (gst_v4l2src_value_simplify (&interlace_formats) + || 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"); |