From a36608cd9a12ad17e538836c4f1b7e50978d8428 Mon Sep 17 00:00:00 2001 From: nicodvb Date: Sat, 13 May 2006 10:09:33 +0000 Subject: [PATCH] when searching ac3 in unqualified pes_private1 streams there's no need to scan > 64 KB of data: frames can't be so far apart git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18475 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_ts.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libmpdemux/demux_ts.c b/libmpdemux/demux_ts.c index 40890b915b..aa6176b09c 100644 --- a/libmpdemux/demux_ts.c +++ b/libmpdemux/demux_ts.c @@ -570,6 +570,8 @@ static off_t ts_detect_streams(demuxer_t *demuxer, tsdemux_init_t *param) if((es.type == PES_PRIVATE1) && (! audio_found)) { pptr = &pes_priv1[es.pid]; + if(pptr->pos < 64*1024) + { tmpbuf = (char*) realloc(pptr->buf, pptr->pos + es.size); if(tmpbuf != NULL) { @@ -583,6 +585,7 @@ static off_t ts_detect_streams(demuxer_t *demuxer, tsdemux_init_t *param) es.type = AUDIO_A52; } } + } } is_audio = IS_AUDIO(es.type) || ((es.type==SL_PES_STREAM) && IS_AUDIO(es.subtype));