--- pwc-v4l2-20050904-042701/pwc-v4l.c 2005-07-25 20:28:36.000000000 +0100 +++ pwc-v4l2-20050904-ivor/pwc-v4l.c 2005-09-04 21:22:16.000000000 +0100 @@ -694,8 +784,11 @@ } case VIDIOC_TRY_FMT: + case VIDIOC_S_FMT: { + int ret, fps, snapshot, compression; struct v4l2_format *f = arg; + Trace(TRACE_MODULE, "ioctl(VIDIOC_TRY_FMT)\n"); if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) return -EINVAL; @@ -713,17 +806,10 @@ else if (f->fmt.pix.height < pdev->view_min.y) f->fmt.pix.height = pdev->view_min.y; + if (cmd == VIDIOC_TRY_FMT) return 0; - } - - case VIDIOC_S_FMT: - { - struct v4l2_format *f = arg; - int ret, fps, snapshot, compression; Trace(TRACE_MODULE, "ioctl(VIDIOC_S_FMT)\n"); - if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) - return -EINVAL; compression = (f->fmt.pix.priv & PWC_QLT_MASK) >> PWC_QLT_SHIFT; snapshot = f->fmt.pix.priv & PWC_FPS_SNAPSHOT; @@ -747,6 +833,7 @@ snapshot); Trace(TRACE_MODULE, "leaving VIDIOC_S_FMT, return=%d\n",ret); + if (ret) return ret;