From 02bcb8e85c63ee981a90daac1a9aeace5f8a07bd Mon Sep 17 00:00:00 2001 From: nicodvb Date: Sat, 22 Sep 2007 08:29:25 +0000 Subject: [PATCH] in ts_detect_streams() moved the iteration condition inside the loop because it depends on the updated value of stream_tell(); (fixes infinite wait on enctrypted TS streams) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24589 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_ts.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libmpdemux/demux_ts.c b/libmpdemux/demux_ts.c index f55407cd14..0e87d6a4b1 100644 --- a/libmpdemux/demux_ts.c +++ b/libmpdemux/demux_ts.c @@ -642,9 +642,12 @@ static off_t ts_detect_streams(demuxer_t *demuxer, tsdemux_init_t *param) init_pos = stream_tell(demuxer->stream); mp_msg(MSGT_DEMUXER, MSGL_V, "PROBING UP TO %"PRIu64", PROG: %d\n", (uint64_t) param->probe, param->prog); end_pos = init_pos + (param->probe ? param->probe : TS_MAX_PROBE_SIZE); - while((pos <= end_pos) && (! demuxer->stream->eof)) + while(1) { pos = stream_tell(demuxer->stream); + if(pos > end_pos || demuxer->stream->eof) + break; + if(ts_parse(demuxer, &es, tmp, 1)) { //Non PES-aligned A52 audio may escape detection if PMT is not present;