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

nicodvb subversion at mplayerhq.hu
Sat Oct 27 21:04:37 CEST 2007


Author: nicodvb
Date: Sat Oct 27 21:04:37 2007
New Revision: 24871

Log:
permit the transititions no stream <-> some streams and viceversa (needed for forthcoming program switching patch)

Modified:
   trunk/libmpdemux/demux_lavf.c

Modified: trunk/libmpdemux/demux_lavf.c
==============================================================================
--- trunk/libmpdemux/demux_lavf.c	(original)
+++ trunk/libmpdemux/demux_lavf.c	Sat Oct 27 21:04:37 2007
@@ -632,8 +632,14 @@ static int demux_lavf_control(demuxer_t 
 	        nstreams = priv->audio_streams;
 	        pstreams = priv->astreams;
 	    }
-	    if(ds->id == -2)
-	        return DEMUXER_CTRL_NOTIMPL;
+	    if(id == -2)
+	    {
+	        if(ds->id >= 0)
+	            priv->avfc->streams[ds->id]->discard = AVDISCARD_ALL;
+	        ds_free_packs(ds);
+	        *((int*)arg) = ds->id = -2;
+	        return DEMUXER_CTRL_OK;
+	    } 
 	    for(i = 0; i < nstreams; i++)
 	    {
 	        if(pstreams[i] == ds->id) //current stream id
@@ -659,13 +665,15 @@ static int demux_lavf_control(demuxer_t 
 		    }
 	        }
 	    }
-	    if(newid == -2 || i == curridx)
+	    if(i == curridx)
 	        return DEMUXER_CTRL_NOTIMPL;
 	    else
 	    {
 	        ds_free_packs(ds);
+	        if(ds->id >= 0)
 	        priv->avfc->streams[ds->id]->discard = AVDISCARD_ALL;
 	        *((int*)arg) = ds->id = newid;
+	        if(newid >= 0)
 	        priv->avfc->streams[newid]->discard = AVDISCARD_NONE;
 	        return DEMUXER_CTRL_OK;
 	    }



More information about the MPlayer-cvslog mailing list