capture-example: don't use bytesperline when allocating buffers
authorMichael Jones <michael.jones@matrix-vision.de>
Mon, 18 Jul 2011 10:00:10 +0000 (07:00 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 13 Aug 2011 18:00:35 +0000 (15:00 -0300)
This removes "buggy driver paranoia", which set sizeimage equal to
at least width * height * 2. This was a false assumption when the
pixel format only required 1 byte per pixel. Originally, the
paranoia was in place to handle drivers which incorrectly set
sizeimage=0, but these seem to have been fixed.

Signed-off-by: Michael Jones <michael.jones@matrix-vision.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
contrib/test/capture-example.c

index 2f77cbf..417615a 100644 (file)
@@ -498,14 +498,6 @@ static void init_device(void)
                        errno_exit("VIDIOC_G_FMT");
        }
 
-       /* Buggy driver paranoia. */
-       min = fmt.fmt.pix.width * 2;
-       if (fmt.fmt.pix.bytesperline < min)
-               fmt.fmt.pix.bytesperline = min;
-       min = fmt.fmt.pix.bytesperline * fmt.fmt.pix.height;
-       if (fmt.fmt.pix.sizeimage < min)
-               fmt.fmt.pix.sizeimage = min;
-
        switch (io) {
        case IO_METHOD_READ:
                init_read(fmt.fmt.pix.sizeimage);