summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demux_ty.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-09-14 19:13:47 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-09-14 19:13:47 +0000
commitcb4d79be6be2845f497688c076ae50618fbc4590 (patch)
tree75d612b83b19429a9ab8b56d3790be5cb3bc4d0c /libmpdemux/demux_ty.c
parent5072dde419fb96cb44bd78aefdb45e318bb113a5 (diff)
downloadmpv-cb4d79be6be2845f497688c076ae50618fbc4590.tar.bz2
mpv-cb4d79be6be2845f497688c076ae50618fbc4590.tar.xz
Get rid of more code duplication
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24494 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/demux_ty.c')
-rw-r--r--libmpdemux/demux_ty.c41
1 files changed, 6 insertions, 35 deletions
diff --git a/libmpdemux/demux_ty.c b/libmpdemux/demux_ty.c
index 7dfc9d2575..590e5d12a4 100644
--- a/libmpdemux/demux_ty.c
+++ b/libmpdemux/demux_ty.c
@@ -447,7 +447,6 @@ static int demux_ty_fill_buffer( demuxer_t *demux, demux_stream_t *dsds )
int esOffset1;
int esOffset2;
- unsigned char lastCC[ 16 ];
unsigned char lastXDS[ 16 ];
TiVoInfo *tivo = demux->priv;
@@ -878,44 +877,16 @@ static int demux_ty_fill_buffer( demuxer_t *demux, demux_stream_t *dsds )
errorHeader++;
}
// ================================================================
- // Closed Caption
+ // 1 = Closed Caption
+ // 2 = Extended Data Services
// ================================================================
- else if ( type == 0x01 )
- {
- unsigned char b1;
- unsigned char b2;
-
- b1 = ( ( ( recPtr[ 0 ] & 0x0f ) << 4 ) |
- ( ( recPtr[ 1 ] & 0xf0 ) >> 4 ) );
- b1 &= 0x7f;
- b2 = ( ( ( recPtr[ 1 ] & 0x0f ) << 4 ) |
- ( ( recPtr[ 2 ] & 0xf0 ) >> 4 ) );
- b2 &= 0x7f;
-
- mp_msg( MSGT_DEMUX, MSGL_DBG3, "ty:CC %x %x\n", b1, b2 );
-
- lastCC[ 0x00 ] = 0x00;
- lastCC[ 0x01 ] = 0x00;
- lastCC[ 0x02 ] = 0x01;
- lastCC[ 0x03 ] = 0xb2;
- lastCC[ 0x04 ] = 'T';
- lastCC[ 0x05 ] = 'Y';
- lastCC[ 0x06 ] = 0x01;
- lastCC[ 0x07 ] = b1;
- lastCC[ 0x08 ] = b2;
- if ( subcc_enabled )
- demux_ty_CopyToDemuxPacket( TY_V, tivo, demux->video, lastCC, 0x09,
- ( demux->filepos + offset ), tivo->lastVideoPTS );
- }
- // ================================================================
- // Extended Data Services
- // ================================================================
- else if ( type == 0x02 )
+ else if ( type == 0x01 || type == 0x02 )
{
+ unsigned char lastXDS[ 16 ];
int b = AV_RB24(recPtr) >> 4;
b &= 0x7f7f;
- mp_msg( MSGT_DEMUX, MSGL_DBG3, "ty:XDS %04x\n", b);
+ mp_msg( MSGT_DEMUX, MSGL_DBG3, "ty:%s %04x\n", type == 1 ? "CC" : "XDS", b);
lastXDS[ 0x00 ] = 0x00;
lastXDS[ 0x01 ] = 0x00;
@@ -923,7 +894,7 @@ static int demux_ty_fill_buffer( demuxer_t *demux, demux_stream_t *dsds )
lastXDS[ 0x03 ] = 0xb2;
lastXDS[ 0x04 ] = 'T';
lastXDS[ 0x05 ] = 'Y';
- lastXDS[ 0x06 ] = 0x02;
+ lastXDS[ 0x06 ] = type;
lastXDS[ 0x07 ] = b >> 8;
lastXDS[ 0x08 ] = b;
if ( subcc_enabled )