aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18/cx18-fileops.c
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2008-12-12 14:24:04 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-30 06:38:32 -0500
commitdd073434b5285121007860914a004320d644ee7e (patch)
tree8ead658f43d30b68c07bea8b8f868835da7e5331 /drivers/media/video/cx18/cx18-fileops.c
parentabb096de82f6f920a06ca935f76925261e66b556 (diff)
V4L/DVB (9805): cx18: Port fix for raw/sliced VBI mixup from ivtv and cx25840
This is a port of the fixes Hans Verkuil made for ivtv/cx25840: The service_set field was used 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 the driver should check on VIDIOC_S_FMT whether the type field matches the raw or sliced VBI type. Updated the cx18 driver accordingly, including an additional check in cx18_start_v4l2_encode_stream() that didn't exist in ivtv. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18/cx18-fileops.c')
-rw-r--r--drivers/media/video/cx18/cx18-fileops.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/media/video/cx18/cx18-fileops.c b/drivers/media/video/cx18/cx18-fileops.c
index 61192e62a80f..1856d59e0cf6 100644
--- a/drivers/media/video/cx18/cx18-fileops.c
+++ b/drivers/media/video/cx18/cx18-fileops.c
@@ -67,12 +67,11 @@ static int cx18_claim_stream(struct cx18_open_id *id, int type)
67 } 67 }
68 s->id = id->open_id; 68 s->id = id->open_id;
69 69
70 /* CX18_DEC_STREAM_TYPE_MPG needs to claim CX18_DEC_STREAM_TYPE_VBI, 70 /* CX18_ENC_STREAM_TYPE_MPG needs to claim CX18_ENC_STREAM_TYPE_VBI
71 CX18_ENC_STREAM_TYPE_MPG needs to claim CX18_ENC_STREAM_TYPE_VBI
72 (provided VBI insertion is on and sliced VBI is selected), for all 71 (provided VBI insertion is on and sliced VBI is selected), for all
73 other streams we're done */ 72 other streams we're done */
74 if (type == CX18_ENC_STREAM_TYPE_MPG && 73 if (type == CX18_ENC_STREAM_TYPE_MPG &&
75 cx->vbi.insert_mpeg && cx->vbi.sliced_in->service_set) { 74 cx->vbi.insert_mpeg && !cx18_raw_vbi(cx)) {
76 vbi_type = CX18_ENC_STREAM_TYPE_VBI; 75 vbi_type = CX18_ENC_STREAM_TYPE_VBI;
77 } else { 76 } else {
78 return 0; 77 return 0;
@@ -258,7 +257,7 @@ static size_t cx18_copy_buf_to_user(struct cx18_stream *s,
258 if (len > ucount) 257 if (len > ucount)
259 len = ucount; 258 len = ucount;
260 if (cx->vbi.insert_mpeg && s->type == CX18_ENC_STREAM_TYPE_MPG && 259 if (cx->vbi.insert_mpeg && s->type == CX18_ENC_STREAM_TYPE_MPG &&
261 cx->vbi.sliced_in->service_set && buf != &cx->vbi.sliced_mpeg_buf) { 260 !cx18_raw_vbi(cx) && buf != &cx->vbi.sliced_mpeg_buf) {
262 const char *start = buf->buf + buf->readpos; 261 const char *start = buf->buf + buf->readpos;
263 const char *p = start + 1; 262 const char *p = start + 1;
264 const u8 *q; 263 const u8 *q;
@@ -333,8 +332,7 @@ static ssize_t cx18_read(struct cx18_stream *s, char __user *ubuf,
333 /* Each VBI buffer is one frame, the v4l2 API says that for VBI the 332 /* Each VBI buffer is one frame, the v4l2 API says that for VBI the
334 frames should arrive one-by-one, so make sure we never output more 333 frames should arrive one-by-one, so make sure we never output more
335 than one VBI frame at a time */ 334 than one VBI frame at a time */
336 if (s->type == CX18_ENC_STREAM_TYPE_VBI && 335 if (s->type == CX18_ENC_STREAM_TYPE_VBI && !cx18_raw_vbi(cx))
337 cx->vbi.sliced_in->service_set)
338 single_frame = 1; 336 single_frame = 1;
339 337
340 for (;;) { 338 for (;;) {