diff options
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-v4l2.c')
-rw-r--r-- | 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 a728ca2a37d..53323c338a6 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, | |||
498 | ret = 0; | 498 | ret = 0; |
499 | switch(vf->type) { | 499 | switch(vf->type) { |
500 | case V4L2_BUF_TYPE_VIDEO_CAPTURE: { | 500 | case V4L2_BUF_TYPE_VIDEO_CAPTURE: { |
501 | int lmin,lmax; | 501 | int lmin,lmax,ldef; |
502 | struct pvr2_ctrl *hcp,*vcp; | 502 | struct pvr2_ctrl *hcp,*vcp; |
503 | int h = vf->fmt.pix.height; | 503 | int h = vf->fmt.pix.height; |
504 | int w = vf->fmt.pix.width; | 504 | int w = vf->fmt.pix.width; |
@@ -507,14 +507,20 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file, | |||
507 | 507 | ||
508 | lmin = pvr2_ctrl_get_min(hcp); | 508 | lmin = pvr2_ctrl_get_min(hcp); |
509 | lmax = pvr2_ctrl_get_max(hcp); | 509 | lmax = pvr2_ctrl_get_max(hcp); |
510 | if (w < lmin) { | 510 | ldef = pvr2_ctrl_get_def(hcp); |
511 | if (w == -1) { | ||
512 | w = ldef; | ||
513 | } else if (w < lmin) { | ||
511 | w = lmin; | 514 | w = lmin; |
512 | } else if (w > lmax) { | 515 | } else if (w > lmax) { |
513 | w = lmax; | 516 | w = lmax; |
514 | } | 517 | } |
515 | lmin = pvr2_ctrl_get_min(vcp); | 518 | lmin = pvr2_ctrl_get_min(vcp); |
516 | lmax = pvr2_ctrl_get_max(vcp); | 519 | lmax = pvr2_ctrl_get_max(vcp); |
517 | if (h < lmin) { | 520 | ldef = pvr2_ctrl_get_def(vcp); |
521 | if (h == -1) { | ||
522 | h = ldef; | ||
523 | } else if (h < lmin) { | ||
518 | h = lmin; | 524 | h = lmin; |
519 | } else if (h > lmax) { | 525 | } else if (h > lmax) { |
520 | h = lmax; | 526 | h = lmax; |