aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-08-20 15:26:40 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 21:06:38 -0400
commitea115d54bc963eb2eb0dc223795f3bd6c689ff99 (patch)
treef18a9b52ea30c55e656a9fc8aaf762a4cddfb388 /drivers
parentad8ff0f10b489562012e433acdac92498fe8bdc9 (diff)
V4L/DVB (6087): ivtv: prevent changing VBI format while capture is in progress
Changing the VBI format requires a CX2341X_ENC_INITIALIZE_INPUT firmware call. This can only be done if no capture is in progress. So return -EBUSY if the encoder is busy. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/ivtv/ivtv-ioctl.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c
index 2bb1e324785b..0dde82f67e26 100644
--- a/drivers/media/video/ivtv/ivtv-ioctl.c
+++ b/drivers/media/video/ivtv/ivtv-ioctl.c
@@ -584,9 +584,7 @@ static int ivtv_try_or_set_fmt(struct ivtv *itv, int streamtype,
584 584
585 /* set raw VBI format */ 585 /* set raw VBI format */
586 if (fmt->type == V4L2_BUF_TYPE_VBI_CAPTURE) { 586 if (fmt->type == V4L2_BUF_TYPE_VBI_CAPTURE) {
587 if (set_fmt && streamtype == IVTV_ENC_STREAM_TYPE_VBI && 587 if (set_fmt && atomic_read(&itv->capturing) > 0) {
588 itv->vbi.sliced_in->service_set &&
589 atomic_read(&itv->capturing) > 0) {
590 return -EBUSY; 588 return -EBUSY;
591 } 589 }
592 if (set_fmt) { 590 if (set_fmt) {
@@ -624,7 +622,7 @@ static int ivtv_try_or_set_fmt(struct ivtv *itv, int streamtype,
624 return 0; 622 return 0;
625 if (set == 0) 623 if (set == 0)
626 return -EINVAL; 624 return -EINVAL;
627 if (atomic_read(&itv->capturing) > 0 && itv->vbi.sliced_in->service_set == 0) { 625 if (atomic_read(&itv->capturing) > 0) {
628 return -EBUSY; 626 return -EBUSY;
629 } 627 }
630 itv->video_dec_func(itv, VIDIOC_S_FMT, fmt); 628 itv->video_dec_func(itv, VIDIOC_S_FMT, fmt);