aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Jones <michael.jones@matrix-vision.de>2011-07-18 10:00:10 (GMT)
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-08-13 18:00:35 (GMT)
commit6235fdde7448138a57ab5b5a471b10fcd452ab77 (patch)
treeac4f0293afb84e4cd6d8f195257033b8bbb8eec6
parenta66d38bd2006ac9705031e048f27e6c480560347 (diff)
capture-example: don't use bytesperline when allocating buffers
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>
-rw-r--r--contrib/test/capture-example.c8
1 files changed, 0 insertions, 8 deletions
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);

Privacy Policy