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

reimar subversion at mplayerhq.hu
Fri Dec 1 20:24:42 CET 2006


Author: reimar
Date: Fri Dec  1 20:24:42 2006
New Revision: 21421

Modified:
   trunk/libmpdemux/demux_avi.c

Log:
Proper fix for last demux_avi commit, stream switching now really should
not hang anymore


Modified: trunk/libmpdemux/demux_avi.c
==============================================================================
--- trunk/libmpdemux/demux_avi.c	(original)
+++ trunk/libmpdemux/demux_avi.c	Fri Dec  1 20:24:42 2006
@@ -775,18 +775,19 @@
 	    if (*(int *)arg >= 0)
 	      ds->id = *(int *)arg;
 	    else {
-	      int id = ds->id;
-	      do {
-	        if (++id >= maxid) id = 0;
-	        if (id == ds->id) // no streams available
-	          return DEMUXER_CTRL_NOTIMPL;
-	      } while (!streams[id]);
-	      ds->id = id;
+	      int i;
+	      for (i = 0; i < maxid; i++) {
+	        if (++ds->id >= maxid) ds->id = 0;
+	        if (streams[ds->id]) break;
+	      }
 	    }
 
 	    chunkid = (ds->id / 10 + '0') | (ds->id % 10 + '0') << 8;
 	    ds->sh = NULL;
-	    demux_avi_select_stream(demuxer, chunkid);
+	    if (!streams[ds->id]) // stream not available
+	      ds->id = -1;
+	    else
+	      demux_avi_select_stream(demuxer, chunkid);
 	    *(int *)arg = ds->id;
 	    return DEMUXER_CTRL_OK;
 	}



More information about the MPlayer-cvslog mailing list