diff mbox

capture-example: don't use bytesperline when allocating buffers

Message ID 1310983210-30769-1-git-send-email-michael.jones@matrix-vision.de (mailing list archive)
State Accepted
Headers show

Commit Message

Michael Jones July 18, 2011, 10 a.m. UTC
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>
---
 contrib/test/capture-example.c |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)
diff mbox

Patch

diff --git a/contrib/test/capture-example.c b/contrib/test/capture-example.c
index 2f77cbf..417615a 100644
--- a/contrib/test/capture-example.c
+++ b/contrib/test/capture-example.c
@@ -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);