changeset 24473:f8971c9855a3

Simplify XDS handling
author reimar
date Fri, 14 Sep 2007 19:07:50 +0000
parents 9341d242f432
children 1754f9ab919e
files libmpdemux/demux_ty.c
diffstat 1 files changed, 5 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_ty.c	Fri Sep 14 18:58:32 2007 +0000
+++ b/libmpdemux/demux_ty.c	Fri Sep 14 19:07:50 2007 +0000
@@ -912,17 +912,10 @@
       // ================================================================
 		else if ( type == 0x02 )
 		{
-			unsigned char b1;
-			unsigned char b2;
+			int b = AV_RB24(recPtr) >> 4;
+			b &= 0x7f7f;
 
-			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: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 @@
 			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 );