[Mplayer-cvslog] CVS: main/libmpdemux demux_real.c,1.7,1.8

Alex Beregszaszi alex at mplayer.dev.hu
Wed Jan 23 20:41:04 CET 2002


Update of /cvsroot/mplayer/main/libmpdemux
In directory mplayer:/var/tmp.root/cvs-serv7733

Modified Files:
	demux_real.c 
Log Message:
fixed num_of_packets and current_packet handling, bug found by Mike Melanson

Index: demux_real.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_real.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- demux_real.c	18 Jan 2002 11:02:52 -0000	1.7
+++ demux_real.c	23 Jan 2002 19:41:01 -0000	1.8
@@ -6,6 +6,9 @@
     Based on FFmpeg's libav/rm.c.
     
     $Log$
+    Revision 1.8  2002/01/23 19:41:01  alex
+    fixed num_of_packets and current_packet handling, bug found by Mike Melanson
+
     Revision 1.7  2002/01/18 11:02:52  alex
     fix dnet support
 
@@ -201,12 +204,10 @@
     int i;
     int flags;
 
-//    printf("num_of_packets: %d\n", priv->num_of_packets);
-
 loop:
-    if ((priv->num_of_packets == 0) && (priv->num_of_packets != -10))
-	return 0; /* EOF */
-    if (priv->current_packet > priv->num_of_packets)
+    /* also don't check if no num_of_packets was defined in header */
+    if ((priv->current_packet > priv->num_of_packets) &&
+	(priv->num_of_packets != -10))
 	return 0; /* EOF */
     stream_skip(demuxer->stream, 2); /* version */
     len = stream_read_word(demuxer->stream);
@@ -230,8 +231,6 @@
 //    printf("packet#%d: pos: %d, len: %d, stream_id: %d, timestamp: %d, flags: %x\n",
 //	priv->current_packet, stream_tell(demuxer->stream)-12, len, stream_id, timestamp, flags);
 
-//    if (priv->num_of_packets != -10)
-//	priv->num_of_packets--;
     priv->current_packet++;
     len -= 12;    
 




More information about the MPlayer-cvslog mailing list