[MPlayer-cvslog] r21083 - trunk/libmpdemux/demux_ts.c

nicodvb subversion at mplayerhq.hu
Mon Nov 20 00:10:30 CET 2006


Author: nicodvb
Date: Mon Nov 20 00:10:30 2006
New Revision: 21083

Modified:
   trunk/libmpdemux/demux_ts.c

Log:
during DEMUXER_CTRL_SWITCH_x *arg set to -2 identifies 'disable stream x'

Modified: trunk/libmpdemux/demux_ts.c
==============================================================================
--- trunk/libmpdemux/demux_ts.c	(original)
+++ trunk/libmpdemux/demux_ts.c	Mon Nov 20 00:10:30 2006
@@ -3189,13 +3189,20 @@
 	{
 		case DEMUXER_CTRL_SWITCH_AUDIO:
 		{
-			sh_audio_t *sh_audio = demuxer->audio->sh;
 			sh_audio_t *sh_a = NULL;
 			int i, n;
-			if(!sh_audio)
-				return DEMUXER_CTRL_NOTIMPL;
 			
 			n = *((int*)arg);
+			if(n == -2)
+			{
+				reset_fifos(priv, 1, 0, 0);
+				demuxer->audio->id = -2;
+				demuxer->audio->sh = NULL;
+				ds_free_packs(demuxer->audio);
+				*((int*)arg) = demuxer->audio->id;
+				return DEMUXER_CTRL_OK;
+			}
+
 			if(n < 0)
 			{
 				for(i = 0; i < 8192; i++)
@@ -3243,13 +3250,20 @@
 		
 		case DEMUXER_CTRL_SWITCH_VIDEO:
 		{
-			sh_video_t *sh_video = demuxer->video->sh;
 			sh_video_t *sh_v = NULL;
 			int i, n;
-			if(!sh_video)
-				return DEMUXER_CTRL_NOTIMPL;
 			
 			n = *((int*)arg);
+			if(n == -2)
+			{
+				reset_fifos(priv, 0, 1, 0);
+				demuxer->video->id = -2;
+				demuxer->video->sh = NULL;
+				ds_free_packs(demuxer->video);
+				*((int*)arg) = demuxer->video->id;
+				return DEMUXER_CTRL_OK;
+			}
+
 			if(n < 0)
 			{
 				for(i = 0; i < 8192; i++)



More information about the MPlayer-cvslog mailing list