summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-09-14 19:07:50 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-09-14 19:07:50 +0000
commit5072dde419fb96cb44bd78aefdb45e318bb113a5 (patch)
treeed38c3b6cf00bfc268a764258d60b03d42083945
parent6b7b78b9a8cc4bd40d6b4e5b35212bad6bc5d6b3 (diff)
downloadmpv-5072dde419fb96cb44bd78aefdb45e318bb113a5.tar.bz2
mpv-5072dde419fb96cb44bd78aefdb45e318bb113a5.tar.xz
Simplify XDS handling
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24493 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--libmpdemux/demux_ty.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/libmpdemux/demux_ty.c b/libmpdemux/demux_ty.c
index bf8a32eb3b..7dfc9d2575 100644
--- a/libmpdemux/demux_ty.c
+++ b/libmpdemux/demux_ty.c
@@ -912,17 +912,10 @@ static int demux_ty_fill_buffer( demuxer_t *demux, demux_stream_t *dsds )
// ================================================================
else if ( type == 0x02 )
{
- 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;
+ int b = AV_RB24(recPtr) >> 4;
+ b &= 0x7f7f;
- mp_msg( MSGT_DEMUX, MSGL_DBG3, "ty:XDS %x %x\n", b1, b2 );
+ mp_msg( MSGT_DEMUX, MSGL_DBG3, "ty:XDS %04x\n", b);
lastXDS[ 0x00 ] = 0x00;
lastXDS[ 0x01 ] = 0x00;
@@ -931,8 +924,8 @@ static int demux_ty_fill_buffer( demuxer_t *demux, demux_stream_t *dsds )
lastXDS[ 0x04 ] = 'T';
lastXDS[ 0x05 ] = 'Y';
lastXDS[ 0x06 ] = 0x02;
- lastXDS[ 0x07 ] = b1;
- lastXDS[ 0x08 ] = b2;
+ lastXDS[ 0x07 ] = b >> 8;
+ lastXDS[ 0x08 ] = b;
if ( subcc_enabled )
demux_ty_CopyToDemuxPacket( TY_V, tivo, demux->video, lastXDS, 0x09,
( demux->filepos + offset ), tivo->lastVideoPTS );