From a8b864354e060dda1000e62d1fea7c1274581caf Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sat, 4 Oct 2008 08:05:30 -0300 Subject: 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 Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/ivtv/ivtv-fileops.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/media/video/ivtv/ivtv-fileops.c') diff --git a/drivers/media/video/ivtv/ivtv-fileops.c b/drivers/media/video/ivtv/ivtv-fileops.c index 304261efc53d..b7457fc60ba5 100644 --- a/drivers/media/video/ivtv/ivtv-fileops.c +++ b/drivers/media/video/ivtv/ivtv-fileops.c @@ -78,7 +78,7 @@ static int ivtv_claim_stream(struct ivtv_open_id *id, int type) if (type == IVTV_DEC_STREAM_TYPE_MPG) { vbi_type = IVTV_DEC_STREAM_TYPE_VBI; } else if (type == IVTV_ENC_STREAM_TYPE_MPG && - itv->vbi.insert_mpeg && itv->vbi.sliced_in->service_set) { + itv->vbi.insert_mpeg && !ivtv_raw_vbi(itv)) { vbi_type = IVTV_ENC_STREAM_TYPE_VBI; } else { return 0; @@ -305,7 +305,7 @@ static size_t ivtv_copy_buf_to_user(struct ivtv_stream *s, struct ivtv_buffer *b if (len > ucount) len = ucount; if (itv->vbi.insert_mpeg && s->type == IVTV_ENC_STREAM_TYPE_MPG && - itv->vbi.sliced_in->service_set && buf != &itv->vbi.sliced_mpeg_buf) { + !ivtv_raw_vbi(itv) && buf != &itv->vbi.sliced_mpeg_buf) { const char *start = buf->buf + buf->readpos; const char *p = start + 1; const u8 *q; @@ -372,7 +372,7 @@ static ssize_t ivtv_read(struct ivtv_stream *s, char __user *ubuf, size_t tot_co /* Each VBI buffer is one frame, the v4l2 API says that for VBI the frames should arrive one-by-one, so make sure we never output more than one VBI frame at a time */ if (s->type == IVTV_DEC_STREAM_TYPE_VBI || - (s->type == IVTV_ENC_STREAM_TYPE_VBI && itv->vbi.sliced_in->service_set)) + (s->type == IVTV_ENC_STREAM_TYPE_VBI && !ivtv_raw_vbi(itv))) single_frame = 1; for (;;) { -- cgit v1.2.3