v4l2object: Ensure max is not smaller then min in decide_allocation
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 6 Dec 2013 00:36:25 +0000 (19:36 -0500)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 10 Jan 2014 22:13:23 +0000 (17:13 -0500)
https://bugzilla.gnome.org/show_bug.cgi?id=720568

sys/v4l2/gstv4l2object.c

index 9d0f809..e605419 100644 (file)
@@ -3190,6 +3190,10 @@ gst_v4l2_object_decide_allocation (GstV4l2Object * obj, GstQuery * query)
     min += ctl.value;
   }
 
+  /* Request a bigger max, if one was suggested but it's too small */
+  if (max != 0 && max < min)
+    max = min;
+
   /* select a pool */
   switch (obj->mode) {
     case GST_V4L2_IO_RW: