diff options
author | Ezequiel Garcia <ezequiel.garcia@free-electrons.com> | 2013-07-18 08:01:23 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2013-07-26 12:31:33 -0400 |
commit | b3ba8fa6b89bd99efe75080bfd8f3168781ae7de (patch) | |
tree | f4693fc452d6c8bd64602648b47bc2b84d5e2841 /drivers/media/usb/stk1160/stk1160-v4l.c | |
parent | 9928ac7cddd5db4cdf3121f1992192adb41df9c3 (diff) |
[media] media: stk1160: Ignore unchanged standard set
This commit adds an early check to vidioc_s_std() to detect if the
new and current standards are equal, and exit with success in that
case.
This is needed to prevent userspace applications that might attempt
to re-set the same standard from failing if that's done when streaming
has started.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/usb/stk1160/stk1160-v4l.c')
-rw-r--r-- | drivers/media/usb/stk1160/stk1160-v4l.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/usb/stk1160/stk1160-v4l.c b/drivers/media/usb/stk1160/stk1160-v4l.c index ee46d82bed5d..c45c9881bb5f 100644 --- a/drivers/media/usb/stk1160/stk1160-v4l.c +++ b/drivers/media/usb/stk1160/stk1160-v4l.c | |||
@@ -379,6 +379,9 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id norm) | |||
379 | struct stk1160 *dev = video_drvdata(file); | 379 | struct stk1160 *dev = video_drvdata(file); |
380 | struct vb2_queue *q = &dev->vb_vidq; | 380 | struct vb2_queue *q = &dev->vb_vidq; |
381 | 381 | ||
382 | if (dev->norm == norm) | ||
383 | return 0; | ||
384 | |||
382 | if (vb2_is_busy(q)) | 385 | if (vb2_is_busy(q)) |
383 | return -EBUSY; | 386 | return -EBUSY; |
384 | 387 | ||