From d36c1d4295c560215e74453978f8017a6030e52b Mon Sep 17 00:00:00 2001 From: nicodvb Date: Sun, 28 Jan 2007 22:41:18 +0000 Subject: [PATCH] sanity checks during codec detection; also reset demuxer->stream->eof git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22059 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_mpg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libmpdemux/demux_mpg.c b/libmpdemux/demux_mpg.c index 6b4a5c4e93..b595ca0074 100644 --- a/libmpdemux/demux_mpg.c +++ b/libmpdemux/demux_mpg.c @@ -1059,11 +1059,13 @@ static demuxer_t* demux_mpg_ps_open(demuxer_t* demuxer) clear_stats(); do { head=sync_video_packet(demuxer->video); + if(!head) break; update_stats(head); skip_video_packet(demuxer->video); - } while(stream_tell(demuxer->stream) < pos + ps_probe); + } while(stream_tell(demuxer->stream) < pos + ps_probe && !demuxer->stream->eof); ds_free_packs(demuxer->video); + demuxer->stream->eof=0; stream_seek(demuxer->stream, pos); mp_msg(MSGT_DEMUX,MSGL_INFO,"MPEG packet stats: p100: %d p101: %d p1B6: %d p12x: %d sli: %d a: %d b: %d c: %d idr: %d sps: %d pps: %d\n", num_elementary_packets100, num_elementary_packets101,