changeset 24569:bc5dfd30626d

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)
author nicodvb
date Sat, 22 Sep 2007 08:29:25 +0000
parents 83c2e53e6e4d
children 2ab48a4978d4
files libmpdemux/demux_ts.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_ts.c	Thu Sep 20 17:55:25 2007 +0000
+++ b/libmpdemux/demux_ts.c	Sat Sep 22 08:29:25 2007 +0000
@@ -642,9 +642,12 @@
 	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;