changeset 22041:f0172904ff02

sanity checks during codec detection; also reset demuxer->stream->eof
author nicodvb
date Sun, 28 Jan 2007 22:41:18 +0000
parents 4b808264eb0c
children 1d3f987634f2
files libmpdemux/demux_mpg.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mpg.c	Sun Jan 28 22:33:51 2007 +0000
+++ b/libmpdemux/demux_mpg.c	Sun Jan 28 22:41:18 2007 +0000
@@ -1059,11 +1059,13 @@
         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,