aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-fileops.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-10-04 07:05:30 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-13 07:08:01 -0400
commita8b864354e060dda1000e62d1fea7c1274581caf (patch)
tree7b1e70dc49c1605a7cdad6b460ea9f602a24b161 /drivers/media/video/ivtv/ivtv-fileops.c
parent3c7b933bea2ee380d54b57b99dee42b1726a4eaa (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-fileops.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-fileops.c6
1 files changed, 3 insertions, 3 deletions
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)
78 if (type == IVTV_DEC_STREAM_TYPE_MPG) { 78 if (type == IVTV_DEC_STREAM_TYPE_MPG) {
79 vbi_type = IVTV_DEC_STREAM_TYPE_VBI; 79 vbi_type = IVTV_DEC_STREAM_TYPE_VBI;
80 } else if (type == IVTV_ENC_STREAM_TYPE_MPG && 80 } else if (type == IVTV_ENC_STREAM_TYPE_MPG &&
81 itv->vbi.insert_mpeg && itv->vbi.sliced_in->service_set) { 81 itv->vbi.insert_mpeg && !ivtv_raw_vbi(itv)) {
82 vbi_type = IVTV_ENC_STREAM_TYPE_VBI; 82 vbi_type = IVTV_ENC_STREAM_TYPE_VBI;
83 } else { 83 } else {
84 return 0; 84 return 0;
@@ -305,7 +305,7 @@ static size_t ivtv_copy_buf_to_user(struct ivtv_stream *s, struct ivtv_buffer *b
305 305
306 if (len > ucount) len = ucount; 306 if (len > ucount) len = ucount;
307 if (itv->vbi.insert_mpeg && s->type == IVTV_ENC_STREAM_TYPE_MPG && 307 if (itv->vbi.insert_mpeg && s->type == IVTV_ENC_STREAM_TYPE_MPG &&
308 itv->vbi.sliced_in->service_set && buf != &itv->vbi.sliced_mpeg_buf) { 308 !ivtv_raw_vbi(itv) && buf != &itv->vbi.sliced_mpeg_buf) {
309 const char *start = buf->buf + buf->readpos; 309 const char *start = buf->buf + buf->readpos;
310 const char *p = start + 1; 310 const char *p = start + 1;
311 const u8 *q; 311 const u8 *q;
@@ -372,7 +372,7 @@ static ssize_t ivtv_read(struct ivtv_stream *s, char __user *ubuf, size_t tot_co
372 /* Each VBI buffer is one frame, the v4l2 API says that for VBI the frames should 372 /* Each VBI buffer is one frame, the v4l2 API says that for VBI the frames should
373 arrive one-by-one, so make sure we never output more than one VBI frame at a time */ 373 arrive one-by-one, so make sure we never output more than one VBI frame at a time */
374 if (s->type == IVTV_DEC_STREAM_TYPE_VBI || 374 if (s->type == IVTV_DEC_STREAM_TYPE_VBI ||
375 (s->type == IVTV_ENC_STREAM_TYPE_VBI && itv->vbi.sliced_in->service_set)) 375 (s->type == IVTV_ENC_STREAM_TYPE_VBI && !ivtv_raw_vbi(itv)))
376 single_frame = 1; 376 single_frame = 1;
377 377
378 for (;;) { 378 for (;;) {