summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demux_ty.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-09-14 18:54:14 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-09-14 18:54:14 +0000
commitc30f384128772032c37dcd0344daeab644eb2d9a (patch)
tree146d4de3503d65432c7f50c748cae9b76929e082 /libmpdemux/demux_ty.c
parent8f0929930806c1e5b3538f501b4b1989542a5970 (diff)
downloadmpv-c30f384128772032c37dcd0344daeab644eb2d9a.tar.bz2
mpv-c30f384128772032c37dcd0344daeab644eb2d9a.tar.xz
Greatly simplify IsValidAudioPacket, though this might break something
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24491 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/demux_ty.c')
-rw-r--r--libmpdemux/demux_ty.c32
1 files changed, 2 insertions, 30 deletions
diff --git a/libmpdemux/demux_ty.c b/libmpdemux/demux_ty.c
index 0be8dab400..01e200716c 100644
--- a/libmpdemux/demux_ty.c
+++ b/libmpdemux/demux_ty.c
@@ -279,30 +279,8 @@ static int tmf_load_chunk( demuxer_t *demux, TiVoInfo *tivo,
#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 @@ static int IsValidAudioPacket( int size, int *ptsOffset, int *ptsLen )
}
// 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;