0003-v4l2src-fix.patch 1.0 KB

1234567891011121314151617181920212223242526272829
  1. --- gst-plugins-good-0.10.31/sys/v4l2/gstv4l2object.c 2011-12-30 14:59:13.000000000 +0100
  2. +++ gst-plugins-good-0.10.31.fixed/sys/v4l2/gstv4l2object.c 2012-06-05 23:45:16.670981047 +0200
  3. @@ -1583,6 +1583,7 @@
  4. if (ival.type == V4L2_FRMIVAL_TYPE_DISCRETE) {
  5. GValue rate = { 0, };
  6. + guint i;
  7. g_value_init (&rates, GST_TYPE_LIST);
  8. g_value_init (&rate, GST_TYPE_FRACTION);
  9. @@ -1602,7 +1603,16 @@
  10. /* swap to get the framerate */
  11. gst_value_set_fraction (&rate, denom, num);
  12. - gst_value_list_append_value (&rates, &rate);
  13. + /* avoid duplicate framerates, yes some hw reports duplicates :( */
  14. + for (i = 0; i < gst_value_list_get_size(&rates); i++) {
  15. + const GValue *val = gst_value_list_get_value(&rates, i);
  16. + if (gst_value_compare(val, &rate) == GST_VALUE_EQUAL) {
  17. + break;
  18. + }
  19. + }
  20. + if (i == gst_value_list_get_size(&rates)) {
  21. + gst_value_list_append_value(&rates, &rate);
  22. + }
  23. ival.index++;
  24. } while (v4l2_ioctl (fd, VIDIOC_ENUM_FRAMEINTERVALS, &ival) >= 0);