summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-07-17 14:29:43 -0700
committerTrent Piepho <xyzzy@speakeasy.org>2007-07-17 14:29:43 -0700
commit85ad95829f3aa0429a0adce713ee9b5fd79421ff (patch)
tree584d77d1073d2342f8d68f530c4081248941c9d8 /linux/drivers/media
parent00392f42737f3848e8c9e33a86480049b38a35fe (diff)
downloadmediapointer-dvb-s2-85ad95829f3aa0429a0adce713ee9b5fd79421ff.tar.gz
mediapointer-dvb-s2-85ad95829f3aa0429a0adce713ee9b5fd79421ff.tar.bz2
zr36067: Driver was not returning correct image size
From: Trent Piepho <xyzzy@speakeasy.org> The driver was returning the size of the (fixed) buffer it allocated as the sizeimage field in the v4l2 pixel format, rather than the actual size of the image. For example, a 192x128 YUYV image is 49152 bytes but the driver would always return 131072 bytes since if that was the size of the v4l buffer. This violates the v4l2 spec, which says that sizeimage should be the actual size of the image for uncompressed formats. It also caused mplayer to crash. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Acked-by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/video/zoran_driver.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/linux/drivers/media/video/zoran_driver.c b/linux/drivers/media/video/zoran_driver.c
index 2d0a7cd9d..b71407821 100644
--- a/linux/drivers/media/video/zoran_driver.c
+++ b/linux/drivers/media/video/zoran_driver.c
@@ -2795,7 +2795,8 @@ zoran_do_ioctl (struct inode *inode,
fmt->fmt.pix.height =
fh->v4l_settings.height;
fmt->fmt.pix.sizeimage =
- fh->v4l_buffers.buffer_size;
+ fh->v4l_settings.bytesperline *
+ fh->v4l_settings.height;
fmt->fmt.pix.pixelformat =
fh->v4l_settings.format->fourcc;
fmt->fmt.pix.colorspace =
@@ -3042,8 +3043,9 @@ zoran_do_ioctl (struct inode *inode,
/* tell the user the
* results/missing stuff */
- fmt->fmt.pix.sizeimage = fh->v4l_buffers.buffer_size /*zr->gbpl * zr->gheight */
- ;
+ fmt->fmt.pix.sizeimage =
+ fh->v4l_settings.height *
+ fh->v4l_settings.bytesperline;
if (BUZ_MAX_HEIGHT <
(fh->v4l_settings.height * 2))
fmt->fmt.pix.field =