This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/xawtv3.git tree:

Subject: v4l2: Add a workaround for bttv kernel driver planar fmt width bug
Author:  Hans de Goede <[email protected]>
Date:    Sun Feb 7 17:21:19 2016 +0100

The bttv driver has a bug where it will return a width which is not
a multiple of 16 for planar formats, while it cannot handle this,
this commit adds a workaround for this.

A kernel fix has been send upstream for this for 4.5 / 4.6, so
eventually this workaround should be removed again.

Signed-off-by: Hans de Goede <[email protected]>

 libng/plugins/drv0-v4l2.tmpl.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

---

http://git.linuxtv.org/cgit.cgi/xawtv3.git/commit/?id=033d4af24e572741d0ab4f6064f01665395c38f9
diff --git a/libng/plugins/drv0-v4l2.tmpl.c b/libng/plugins/drv0-v4l2.tmpl.c
index 2cbd34bb6584..8186ac77c8b3 100644
--- a/libng/plugins/drv0-v4l2.tmpl.c
+++ b/libng/plugins/drv0-v4l2.tmpl.c
@@ -1122,6 +1122,22 @@ retry:
     }
     if (h->fmt_v4l2.fmt.pix.pixelformat != xawtv_pixelformat[fmt->fmtid])
        return -1;
+
+    /*
+     * The bttv driver has a bug where it will return a width which is not
+     * a multiple of 16 for planar formats, while it cannot handle this,
+     * fix this up.
+     *
+     * A kernel fix has been send upstream for this for 4.5 / 4.6, so
+     * eventually this workaround should be removed.
+     */
+    if (!strcmp(h->cap.driver, "bttv") &&
+            (fmt->fmtid == VIDEO_YUV422P || fmt->fmtid == VIDEO_YUV420P) &&
+            h->fmt_v4l2.fmt.pix.width % 16) {
+        fmt->width = h->fmt_v4l2.fmt.pix.width & ~15;
+        goto retry;
+    }
+
     fmt->width        = h->fmt_v4l2.fmt.pix.width;
     fmt->height       = h->fmt_v4l2.fmt.pix.height;
     fmt->bytesperline = h->fmt_v4l2.fmt.pix.bytesperline;

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to