Commit 6ec3cc70 authored by Víctor Manuel Jáquez Leal's avatar Víctor Manuel Jáquez Leal
Browse files

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.
parent 0a81f71d
......@@ -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);
GST_WARNING_OBJECT (v4l2object, "Failed to determine interlace mode");
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment