Commit dcea1b2d authored by Sjoerd Simons's avatar Sjoerd Simons Committed by Tim-Philipp Müller

v4l2: sort formats in the right order so that non-emulated formats are prefered

The format list should be sorted from high ranks to low ranks. In the GSList
sorting function this means the compare needs to return a positive value if
format a has a lower rank than format b.

Among other things this fixes v4l2src to prefer non-emulated formats
to emulated formats when built against libv4l.
parent 19c8226c
......@@ -864,8 +864,8 @@ format_cmp_func (gconstpointer a, gconstpointer b)
if (fa->pixelformat == fb->pixelformat)
return 0;
return gst_v4l2_object_format_get_rank (fa) -
gst_v4l2_object_format_get_rank (fb);
return gst_v4l2_object_format_get_rank (fb) -
gst_v4l2_object_format_get_rank (fa);
}
/******************************************************
......
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