diff options
author | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2010-08-06 18:07:46 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2010-08-06 20:07:21 +0100 |
commit | dcea1b2dfcdad92c381281aafd09786a7abe8a83 (patch) | |
tree | dabf7790d1257ca7cc09292198c4080232c07cc3 | |
parent | 19c8226c6dcf25d2d27485fc3acc2151b462ca6e (diff) |
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.
-rw-r--r-- | sys/v4l2/gstv4l2object.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index 37a30e344..c77da5e97 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -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); } /****************************************************** |