Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=34ca7d3791c6a467ff6810a149bdf78be086c23a
Commit:     34ca7d3791c6a467ff6810a149bdf78be086c23a
Parent:     6659e3ed559db2e730947268f9d57869b7a9016c
Author:     Hans Verkuil <[EMAIL PROTECTED]>
AuthorDate: Fri Oct 12 12:39:36 2007 -0300
Committer:  Mauro Carvalho Chehab <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 12:01:46 2007 -0200

    V4L/DVB (6341): ivtv: fix resizing MPEG1 streams
    
    Resizing an MPEG 1 stream would cut off the right half of the
    image due to a missing divide by 2 in VIDIOC_S_FMT.
    
    Also did some minor cleanup in this part of the code.
    
    Signed-off-by: Hans Verkuil <[EMAIL PROTECTED]>
    Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
---
 drivers/media/video/ivtv/ivtv-ioctl.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c 
b/drivers/media/video/ivtv/ivtv-ioctl.c
index 206eee7..fd6826f 100644
--- a/drivers/media/video/ivtv/ivtv-ioctl.c
+++ b/drivers/media/video/ivtv/ivtv-ioctl.c
@@ -555,6 +555,7 @@ static int ivtv_try_or_set_fmt(struct ivtv *itv, int 
streamtype,
 
        /* set window size */
        if (fmt->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
+               struct cx2341x_mpeg_params *p = &itv->params;
                int w = fmt->fmt.pix.width;
                int h = fmt->fmt.pix.height;
 
@@ -566,17 +567,19 @@ static int ivtv_try_or_set_fmt(struct ivtv *itv, int 
streamtype,
                fmt->fmt.pix.width = w;
                fmt->fmt.pix.height = h;
 
-               if (!set_fmt || (itv->params.width == w && itv->params.height 
== h))
+               if (!set_fmt || (p->width == w && p->height == h))
                        return 0;
                if (atomic_read(&itv->capturing) > 0)
                        return -EBUSY;
 
-               itv->params.width = w;
-               itv->params.height = h;
+               p->width = w;
+               p->height = h;
                if (w != 720 || h != (itv->is_50hz ? 576 : 480))
-                       itv->params.video_temporal_filter = 0;
+                       p->video_temporal_filter = 0;
                else
-                       itv->params.video_temporal_filter = 8;
+                       p->video_temporal_filter = 8;
+               if (p->video_encoding == V4L2_MPEG_VIDEO_ENCODING_MPEG_1)
+                       fmt->fmt.pix.width /= 2;
                itv->video_dec_func(itv, VIDIOC_S_FMT, fmt);
                return ivtv_get_fmt(itv, streamtype, fmt);
        }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to