[MPlayer-cvslog] r29660 - trunk/libmpdemux/demux_lavf.c

reimar subversion at mplayerhq.hu
Tue Sep 8 11:08:05 CEST 2009


Author: reimar
Date: Tue Sep  8 11:08:05 2009
New Revision: 29660

Log:
Fix an endless loop if all programs are empty.

Modified:
   trunk/libmpdemux/demux_lavf.c

Modified: trunk/libmpdemux/demux_lavf.c
==============================================================================
--- trunk/libmpdemux/demux_lavf.c	Tue Sep  8 11:07:23 2009	(r29659)
+++ trunk/libmpdemux/demux_lavf.c	Tue Sep  8 11:08:05 2009	(r29660)
@@ -707,6 +707,7 @@ static int demux_lavf_control(demuxer_t 
             demux_program_t *prog = arg;
             AVProgram *program;
             int p, i;
+            int start;
 
             if(priv->avfc->nb_programs < 2)
                 return DEMUXER_CTRL_NOTIMPL;
@@ -728,6 +729,7 @@ static int demux_lavf_control(demuxer_t 
                 p = i;
             }
             prog->vid = prog->aid = prog->sid = -2;	//no audio and no video by default
+            start = p;
 redo:
             program = priv->avfc->programs[p];
             for(i=0; i<program->nb_stream_indexes; i++)
@@ -751,6 +753,8 @@ redo:
             if(prog->progid == -1 && prog->vid == -2 && prog->aid == -2)
             {
                 p = (p + 1) % priv->avfc->nb_programs;
+                if (p == start)
+                    return DEMUXER_CTRL_DONTKNOW;
                 goto redo;
             }
             priv->cur_program = prog->progid = program->id;


More information about the MPlayer-cvslog mailing list