From patchwork Mon Jul 18 10:00:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Jones X-Patchwork-Id: 985782 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6IA1iEE012912 for ; Mon, 18 Jul 2011 10:01:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753440Ab1GRKBX (ORCPT ); Mon, 18 Jul 2011 06:01:23 -0400 Received: from mail2.matrix-vision.com ([85.214.244.251]:34657 "EHLO mail2.matrix-vision.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753200Ab1GRKBW (ORCPT ); Mon, 18 Jul 2011 06:01:22 -0400 Received: from mail2.matrix-vision.com (localhost [127.0.0.1]) by mail2.matrix-vision.com (Postfix) with ESMTP id CD259405F9; Mon, 18 Jul 2011 12:01:20 +0200 (CEST) Received: from erinome (g2.matrix-vision.com [80.152.136.245]) by mail2.matrix-vision.com (Postfix) with ESMTPA id 9B6A93F626; Mon, 18 Jul 2011 12:01:20 +0200 (CEST) Received: from erinome (localhost [127.0.0.1]) by erinome (Postfix) with ESMTP id D7BB76F8A; Mon, 18 Jul 2011 12:01:19 +0200 (CEST) Received: by erinome (Postfix, from userid 108) id C903E6F9C; Mon, 18 Jul 2011 12:01:19 +0200 (CEST) Received: from ap437-joe.intern.matrix-vision.de (host65-46.intern.matrix-vision.de [192.168.65.46]) by erinome (Postfix) with ESMTPA id B620B6F8A; Mon, 18 Jul 2011 12:01:19 +0200 (CEST) From: Michael Jones To: Linux Media Mailing List Cc: Mauro Carvalho Chehab Subject: [PATCH] capture-example: don't use bytesperline when allocating buffers Date: Mon, 18 Jul 2011 12:00:10 +0200 Message-Id: <1310983210-30769-1-git-send-email-michael.jones@matrix-vision.de> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <4E1ECB5F.8030308@redhat.com> References: <4E1ECB5F.8030308@redhat.com> X-MV-Disclaimer: true (erinome) X-AV-Checked: ClamAV using ClamSMTP (erinome) X-AV-Checked: ClamAV using ClamSMTP (mail2) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Mon, 18 Jul 2011 10:01:45 +0000 (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 --- contrib/test/capture-example.c | 8 -------- 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);