Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fd69496461050296fb0fdd9acf6d789d27a0ef44
Commit:     fd69496461050296fb0fdd9acf6d789d27a0ef44
Parent:     848ed3ca2a4eb85d6c6bde2a1b254b1f4c658e02
Author:     Pantelis Koukousoulas <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 20 01:59:54 2007 -0300
Committer:  Mauro Carvalho Chehab <[EMAIL PROTECTED]>
CommitDate: Wed Feb 21 13:34:42 2007 -0200

    V4L/DVB (5095): Pvrusb2: Allow VIDIOC_S_FMT with -1 for resolution values
    
    With the previous patch, mplayer started but was polling the video
    device forever without any video actually coming out. Further analysis
    showed that it does a VIDIOC_S_FMT with width and height set to -1 (!!!).
    The code handling this only cares that both are lower than the minimum
    range allowed so it ends up setting the size to 19x17 (!!) This pretty
    much breaks the encoder here. Even if this breakage is yet another (TM)
    result of my setup, setting the size to 19x17 by default would surprise
    most users IMHO.
    So, special case for -1 and interpret this to be a request for the
    default size, please. Users can then set their favorite size both
    through mplayer and through sysfs.
    With this patch, mplayer finally works in pvr:// mode (not that we
    really gain anything over operating it through sysfs with lirc,
    sometime I might actually get off my lazy a** and contribute this
    setup too)
    
    Signed-off-by: Pantelis Koukousoulas <[EMAIL PROTECTED]>
    Signed-off-by: Mike Isely <[EMAIL PROTECTED]>
    Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
---
 drivers/media/video/pvrusb2/pvrusb2-v4l2.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c 
b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
index a728ca2..53323c3 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
@@ -498,7 +498,7 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct 
file *file,
                ret = 0;
                switch(vf->type) {
                case V4L2_BUF_TYPE_VIDEO_CAPTURE: {
-                       int lmin,lmax;
+                       int lmin,lmax,ldef;
                        struct pvr2_ctrl *hcp,*vcp;
                        int h = vf->fmt.pix.height;
                        int w = vf->fmt.pix.width;
@@ -507,14 +507,20 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct 
file *file,
 
                        lmin = pvr2_ctrl_get_min(hcp);
                        lmax = pvr2_ctrl_get_max(hcp);
-                       if (w < lmin) {
+                       ldef = pvr2_ctrl_get_def(hcp);
+                       if (w == -1) {
+                               w = ldef;
+                       } else if (w < lmin) {
                                w = lmin;
                        } else if (w > lmax) {
                                w = lmax;
                        }
                        lmin = pvr2_ctrl_get_min(vcp);
                        lmax = pvr2_ctrl_get_max(vcp);
-                       if (h < lmin) {
+                       ldef = pvr2_ctrl_get_def(vcp);
+                       if (h == -1) {
+                               h = ldef;
+                       } else if (h < lmin) {
                                h = lmin;
                        } else if (h > lmax) {
                                h = lmax;
-
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