[MPlayer-cvslog] r21420 - trunk/libmpdemux/demux_avi.c

reimar subversion at mplayerhq.hu
Fri Dec 1 19:51:45 CET 2006


Author: reimar
Date: Fri Dec  1 19:51:44 2006
New Revision: 21420

Modified:
   trunk/libmpdemux/demux_avi.c

Log:
Make sure we do not hang if no streams are available


Modified: trunk/libmpdemux/demux_avi.c
==============================================================================
--- trunk/libmpdemux/demux_avi.c	(original)
+++ trunk/libmpdemux/demux_avi.c	Fri Dec  1 19:51:44 2006
@@ -775,9 +775,13 @@
 	    if (*(int *)arg >= 0)
 	      ds->id = *(int *)arg;
 	    else {
+	      int id = ds->id;
 	      do {
-	        if (++ds->id >= maxid) ds->id = 0;
-	      } while (!streams[ds->id]);
+	        if (++id >= maxid) id = 0;
+	        if (id == ds->id) // no streams available
+	          return DEMUXER_CTRL_NOTIMPL;
+	      } while (!streams[id]);
+	      ds->id = id;
 	    }
 
 	    chunkid = (ds->id / 10 + '0') | (ds->id % 10 + '0') << 8;



More information about the MPlayer-cvslog mailing list