Mercurial > mplayer.hg
changeset 24471:516c6a2277b1
Greatly simplify IsValidAudioPacket, though this might break something
author | reimar |
---|---|
date | Fri, 14 Sep 2007 18:54:14 +0000 |
parents | 656a62a00e94 |
children | 9341d242f432 |
files | libmpdemux/demux_ty.c |
diffstat | 1 files changed, 2 insertions(+), 30 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpdemux/demux_ty.c Fri Sep 14 18:50:25 2007 +0000 +++ b/libmpdemux/demux_ty.c Fri Sep 14 18:54:14 2007 +0000 @@ -279,30 +279,8 @@ #define AC3_PTS_LENGTH 16 #define AC3_PTS_OFFSET 9 -#define NUMBER_DIFFERENT_AUDIO_SIZES 7 -static int Series1AudioWithPTS[ NUMBER_DIFFERENT_AUDIO_SIZES ] = -{ - 336 + SERIES1_PTS_LENGTH, - 384 + SERIES1_PTS_LENGTH, - 480 + SERIES1_PTS_LENGTH, - 576 + SERIES1_PTS_LENGTH, - 768 + SERIES1_PTS_LENGTH, - 864 + SERIES1_PTS_LENGTH -}; -static int Series2AudioWithPTS[ NUMBER_DIFFERENT_AUDIO_SIZES ] = -{ - 336 + SERIES2_PTS_LENGTH, - 384 + SERIES2_PTS_LENGTH, - 480 + SERIES2_PTS_LENGTH, - 576 + SERIES2_PTS_LENGTH, - 768 + SERIES2_PTS_LENGTH, - 864 + SERIES2_PTS_LENGTH -}; - static int IsValidAudioPacket( int size, int *ptsOffset, int *ptsLen ) { - int count; - *ptsOffset = 0; *ptsLen = 0; @@ -315,24 +293,18 @@ } // MPEG - for( count = 0 ; count < NUMBER_DIFFERENT_AUDIO_SIZES ; count++ ) - { - if ( size == Series1AudioWithPTS[ count ] ) + if ( (size & 15) == (SERIES1_PTS_LENGTH & 15) ) { *ptsOffset = SERIES1_PTS_OFFSET; *ptsLen = SERIES1_PTS_LENGTH; return 1; } - } - for( count = 0 ; count < NUMBER_DIFFERENT_AUDIO_SIZES ; count++ ) - { - if ( size == Series2AudioWithPTS[ count ] ) + if ( (size & 15) == (SERIES2_PTS_LENGTH & 15) ) { *ptsOffset = SERIES2_PTS_OFFSET; *ptsLen = SERIES2_PTS_LENGTH; return 1; } - } mp_msg( MSGT_DEMUX, MSGL_DBG3, "ty:Tossing Audio Packet Size %d\n", size ); return 0;