[vlc-commits] v4l2: respect line pitch specified by the device driver (fixes #8802)

Rémi Denis-Courmont git at videolan.org
Sun Jun 16 17:43:43 CEST 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jun 16 18:43:17 2013 +0300| [45f780608d3d7fc810cb3916672a016e185da789] | committer: Rémi Denis-Courmont

v4l2: respect line pitch specified by the device driver (fixes #8802)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=45f780608d3d7fc810cb3916672a016e185da789
---

 modules/access/v4l2/demux.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/modules/access/v4l2/demux.c b/modules/access/v4l2/demux.c
index ec98dc3..73af8ce 100644
--- a/modules/access/v4l2/demux.c
+++ b/modules/access/v4l2/demux.c
@@ -393,7 +393,11 @@ static int InitVideo (demux_t *demux, int fd, uint32_t caps)
     es_fmt.video.i_rmask = selected->red;
     es_fmt.video.i_gmask = selected->green;
     es_fmt.video.i_bmask = selected->blue;
-    es_fmt.video.i_width = fmt.fmt.pix.width;
+    es_fmt.video.i_visible_width = fmt.fmt.pix.width;
+    if (fmt.fmt.pix.bytesperline != 0 && selected->bpp != 0)
+        es_fmt.video.i_width = fmt.fmt.pix.bytesperline / selected->bpp;
+    else
+        es_fmt.video.i_width = fmt.fmt.pix.width;
     es_fmt.video.i_height = fmt.fmt.pix.height;
     es_fmt.video.i_frame_rate = parm.parm.capture.timeperframe.denominator;
     es_fmt.video.i_frame_rate_base = parm.parm.capture.timeperframe.numerator;



More information about the vlc-commits mailing list