diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-10-04 07:05:30 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-13 07:08:01 -0400 |
commit | a8b864354e060dda1000e62d1fea7c1274581caf (patch) | |
tree | 7b1e70dc49c1605a7cdad6b460ea9f602a24b161 /drivers/media/video/ivtv/ivtv-ioctl.c | |
parent | 3c7b933bea2ee380d54b57b99dee42b1726a4eaa (diff) |
V4L/DVB (9162): ivtv: fix raw/sliced VBI mixup
The service_set field was used in saa7115 and cx25840 to determine
whether raw or sliced VBI was desired. This is incorrect since it is
perfectly valid to select sliced VBI with a service_set of 0.
Instead these drivers should checked on VIDIOC_S_FMT whether the type
field matches the raw or sliced VBI type.
Updated ivtv accordingly.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-ioctl.c')
-rw-r--r-- | drivers/media/video/ivtv/ivtv-ioctl.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c index f5b289ef4103..3d0013bdd1fd 100644 --- a/drivers/media/video/ivtv/ivtv-ioctl.c +++ b/drivers/media/video/ivtv/ivtv-ioctl.c | |||
@@ -575,8 +575,11 @@ static int ivtv_s_fmt_vbi_cap(struct file *file, void *fh, struct v4l2_format *f | |||
575 | { | 575 | { |
576 | struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv; | 576 | struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv; |
577 | 577 | ||
578 | if (!ivtv_raw_vbi(itv) && atomic_read(&itv->capturing) > 0) | ||
579 | return -EBUSY; | ||
578 | itv->vbi.sliced_in->service_set = 0; | 580 | itv->vbi.sliced_in->service_set = 0; |
579 | itv->video_dec_func(itv, VIDIOC_S_FMT, &itv->vbi.in); | 581 | itv->vbi.in.type = V4L2_BUF_TYPE_VBI_CAPTURE; |
582 | itv->video_dec_func(itv, VIDIOC_S_FMT, fmt); | ||
580 | return ivtv_g_fmt_vbi_cap(file, fh, fmt); | 583 | return ivtv_g_fmt_vbi_cap(file, fh, fmt); |
581 | } | 584 | } |
582 | 585 | ||
@@ -591,8 +594,9 @@ static int ivtv_s_fmt_sliced_vbi_cap(struct file *file, void *fh, struct v4l2_fo | |||
591 | return ret; | 594 | return ret; |
592 | 595 | ||
593 | check_service_set(vbifmt, itv->is_50hz); | 596 | check_service_set(vbifmt, itv->is_50hz); |
594 | if (atomic_read(&itv->capturing) > 0) | 597 | if (ivtv_raw_vbi(itv) && atomic_read(&itv->capturing) > 0) |
595 | return -EBUSY; | 598 | return -EBUSY; |
599 | itv->vbi.in.type = V4L2_BUF_TYPE_SLICED_VBI_CAPTURE; | ||
596 | itv->video_dec_func(itv, VIDIOC_S_FMT, fmt); | 600 | itv->video_dec_func(itv, VIDIOC_S_FMT, fmt); |
597 | memcpy(itv->vbi.sliced_in, vbifmt, sizeof(*itv->vbi.sliced_in)); | 601 | memcpy(itv->vbi.sliced_in, vbifmt, sizeof(*itv->vbi.sliced_in)); |
598 | return 0; | 602 | return 0; |