]> git.sesse.net Git - vlc/commitdiff
* input: :demux=module really force module and bypass demuxer module given
authorLaurent Aimar <fenrir@videolan.org>
Thu, 6 Oct 2005 22:09:24 +0000 (22:09 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Thu, 6 Oct 2005 22:09:24 +0000 (22:09 +0000)
by access.
 * udp: force ts demux on payload 33 (:demux=dump will work)

modules/access/udp.c
src/input/input.c

index e4fe0b800e8ac542a58ab2a7a466b20066769edf..916dd4749058c14f770bd9916b02d7ea0f57f715 100644 (file)
@@ -456,8 +456,7 @@ static block_t *BlockChoose( access_t *p_access )
     {
         case 33:
             msg_Dbg( p_access, "detected TS over RTP" );
-            /* Disabled because it is auto-detected. */
-            /* p_access->psz_demux = strdup( "ts" ); */
+            p_access->psz_demux = strdup( "ts" );
             break;
 
         case 14:
index 849ef305c34980d8a3ba67847b4d0013b3c42651..fa808f85115ed8b8a3d077a3b37d1c34a94d959f 100644 (file)
@@ -1924,7 +1924,7 @@ static int InputSourceInit( input_thread_t *p_input,
     vlc_value_t val;
 
     if( !in ) return VLC_EGENERIC;
-    
+
     /* Split uri */
     if( !b_quick )
     {
@@ -1944,7 +1944,29 @@ static int InputSourceInit( input_thread_t *p_input,
                      &in->i_seekpoint_start, &in->i_seekpoint_end );
 
         if( psz_forced_demux && *psz_forced_demux )
+        {
+            if( psz_demux ) free( psz_demux );
             psz_demux = psz_forced_demux;
+        }
+        else if( !psz_demux || *psz_demux == '\0' )
+        {
+            /* special hack for forcing a demuxer with --demux=module
+             * (and do nothing with a list) */
+            char *psz_var_demux = var_GetString( p_input, "demux" );
+
+            if( *psz_var_demux != '\0' &&
+                !strchr(psz_var_demux, ',' ) &&
+                !strchr(psz_var_demux, ':' ) )
+            {
+                psz_demux = psz_var_demux;
+
+                msg_Dbg( p_input, "Enforce demux ` %s'", psz_demux );
+            }
+            else if( psz_var_demux )
+            {
+                free( psz_var_demux );
+            }
+        }
 
         /* Try access_demux if no demux given */
         if( *psz_demux == '\0' )