]> git.sesse.net Git - vlc/commitdiff
* all: a new --input-slave option to start playing with multi-input (#
authorLaurent Aimar <fenrir@videolan.org>
Sun, 27 Jun 2004 19:54:35 +0000 (19:54 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Sun, 27 Jun 2004 19:54:35 +0000 (19:54 +0000)
 is used as a separator), it may or may not work (depend a lot on the
 demux).

src/input/input.c
src/input/var.c
src/libvlc.h

index 0f555d5cf14dd790affbfb7da0f8330b886dbf1e..b64273479fcb9d7cbbf7b68f9110a0028098a1a3 100644 (file)
@@ -685,6 +685,41 @@ static int Init( input_thread_t * p_input )
     }
     free( psz_subtitle );
 
+    /* Look for slave */
+    psz = var_GetString( p_input, "input-slave" );
+    if( *psz )
+    {
+        char *psz_delim = strchr( psz, '#' );
+
+        for( ;; )
+        {
+            input_source_t *slave;
+
+            if( psz_delim )
+            {
+                *psz_delim++ = '\0';
+            }
+
+            if( *psz == '\0' )
+            {
+                if( psz_delim )
+                    continue;
+                else
+                    break;
+            }
+
+            msg_Dbg( p_input, "adding slave '%s'", psz );
+            slave = InputSourceNew( p_input );
+            if( !InputSourceInit( p_input, slave, psz, NULL ) )
+            {
+                TAB_APPEND( p_input->i_slave, p_input->slave, slave );
+            }
+            if( !psz_delim )
+                break;
+        }
+    }
+    free( psz );
+
     /* Set up es_out */
     es_out_Control( p_input->p_es_out, ES_OUT_SET_ACTIVE, VLC_TRUE );
     val.b_bool =  VLC_FALSE;
index 89cfa4c350ac4a633ef4a3785f4f4dc10aa71fdb..aecd575b38c4d7f82cfd5295db76e75e65e9a04b 100644 (file)
@@ -426,6 +426,7 @@ void input_ConfigVarInit ( input_thread_t *p_input )
     val.b_bool = VLC_TRUE; /* Fixed later*/
     var_Change( p_input, "seekable", VLC_VAR_SETVALUE, &val, NULL );
 
+    var_Create( p_input, "input-slave", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
 }
 
 /*****************************************************************************
index 67f497388e1cdc739058f409d9be81a29a68ace9..d20d32d6a2b7161483f399675c41af425d49dd19 100644 (file)
@@ -315,6 +315,9 @@ static char *ppsz_align_descriptions[] =
 #define STOP_TIME_TEXT N_("Input stop time (seconds)")
 #define STOP_TIME_LONGTEXT N_("Input stop time (seconds)")
 
+#define INPUT_SLAVE_TEXT N_("Input slave (experimental)")
+#define INPUT_SLAVE_LONGTEXT N_("Input slave (experimental)")
+
 #define BOOKMARKS_TEXT N_("Bookmarks list for a stream")
 #define BOOKMARKS_LONGTEXT N_("You can specify a list of bookmarks for a stream in " \
     "the form \"{name=bookmark-name,time=optional-time-offset," \
@@ -862,6 +865,9 @@ vlc_module_begin();
                  START_TIME_TEXT, START_TIME_LONGTEXT, VLC_TRUE );
     add_integer( "stop-time", 0, NULL,
                  STOP_TIME_TEXT, STOP_TIME_LONGTEXT, VLC_TRUE );
+    add_string( "input-slave", NULL, NULL,
+                 INPUT_SLAVE_TEXT, INPUT_SLAVE_LONGTEXT, VLC_TRUE );
+
     add_string( "bookmarks", NULL, NULL,
                  BOOKMARKS_TEXT, BOOKMARKS_LONGTEXT, VLC_TRUE );