diff options
author | Andy Walls <awalls@radix.net> | 2009-02-01 19:42:12 -0500 |
---|---|---|
committer | Andy Walls <awalls@radix.net> | 2009-02-01 19:42:12 -0500 |
commit | 343fbdd2e3f93d7a107012ecc1413cae5664e096 (patch) | |
tree | e711aa3f3a2082c91ddafa521bba6375c6f06c6f /linux/drivers/media/video/cx18/cx18-vbi.c | |
parent | adbc75d3cf3691d649c8dac1f32ee21f332f0f4c (diff) | |
download | mediapointer-dvb-s2-343fbdd2e3f93d7a107012ecc1413cae5664e096.tar.gz mediapointer-dvb-s2-343fbdd2e3f93d7a107012ecc1413cae5664e096.tar.bz2 |
cx18: Fix presentation timestamp (PTS) for VBI buffers
From: Andy Walls <awalls@radix.net>
The old code from ivtv used a CX23415/6 PTS, which was simply left at 0 in the
cx18 driver. Since the CX23418 gives us what I think is a PTS (or some other
90 kHz clock count) with each VBI buffer, this change has the cx18 driver use
that as a PTS.
Priority: normal
Signed-off-by: Andy Walls <awalls@radix.net>
Diffstat (limited to 'linux/drivers/media/video/cx18/cx18-vbi.c')
-rw-r--r-- | linux/drivers/media/video/cx18/cx18-vbi.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/linux/drivers/media/video/cx18/cx18-vbi.c b/linux/drivers/media/video/cx18/cx18-vbi.c index 38d26c42e..d6e15e119 100644 --- a/linux/drivers/media/video/cx18/cx18-vbi.c +++ b/linux/drivers/media/video/cx18/cx18-vbi.c @@ -168,27 +168,28 @@ static u32 compress_sliced_buf(struct cx18 *cx, u32 line, u8 *buf, } void cx18_process_vbi_data(struct cx18 *cx, struct cx18_buffer *buf, - u64 pts_stamp, int streamtype) + int streamtype) { u8 *p = (u8 *) buf->buf; + u32 *q = (u32 *) buf->buf; u32 size = buf->bytesused; + u32 pts; int lines; if (streamtype != CX18_ENC_STREAM_TYPE_VBI) return; + cx18_buf_swap(buf); + /* - * Note the CX23418 provides a 12 byte header, in it's raw VBI - * buffers to us, that we currently throw away: - * 0x3fffffff [4 bytes of something] [4 byte timestamp] + * The CX23418 provides a 12 byte header in it's raw VBI buffers to us: + * 0x3fffffff [4 bytes of something] [4 byte presentation time stamp?] */ /* Raw VBI data */ if (cx18_raw_vbi(cx)) { u8 type; - cx18_buf_swap(buf); - /* Skip 12 bytes of header that gets stuffed in */ size -= 12; memcpy(p, &buf->buf[12], size); @@ -208,7 +209,8 @@ void cx18_process_vbi_data(struct cx18 *cx, struct cx18_buffer *buf, } /* Sliced VBI data with data insertion */ - cx18_buf_swap(buf); + + pts = (q[0] == 0x3fffffff) ? q[2] : 0; /* first field */ /* compress_sliced_buf() will skip the 12 bytes of header */ @@ -230,6 +232,6 @@ void cx18_process_vbi_data(struct cx18 *cx, struct cx18_buffer *buf, memcpy(p, &cx->vbi.sliced_data[0], size); if (cx->vbi.insert_mpeg) - copy_vbi_data(cx, lines, pts_stamp); + copy_vbi_data(cx, lines, pts); cx->vbi.frame++; } |