]> git.sesse.net Git - vlc/commitdiff
* Support Kasenna simulcast. Weird stuff is still happening though with the image.
authorDerk-Jan Hartman <hartman@videolan.org>
Sat, 13 Nov 2004 01:35:28 +0000 (01:35 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Sat, 13 Nov 2004 01:35:28 +0000 (01:35 +0000)
modules/demux/sgimb.c

index 7971924d1aa58fdd4ee8b4aa521d81d466fcaede..263a36303abbbd299d4edf9f5d59e575196a2253 100644 (file)
@@ -135,6 +135,7 @@ struct demux_sys_t
     mtime_t     i_duration;     /* sgiDuration= */
     int         i_port;         /* sgiRtspPort= */
     int         i_sid;          /* sgiSid= */
+    vlc_bool_t  b_concert;      /* DeliveryService=cds */
     vlc_bool_t  b_rtsp_kasenna; /* kasenna style RTSP */
 };
 
@@ -180,7 +181,9 @@ static int Activate( vlc_object_t * p_this )
             p_sys->i_packet_size = 0;
             p_sys->i_duration = 0;
             p_sys->i_port = 0;
+            p_sys->i_sid = 0;
             p_sys->b_rtsp_kasenna = VLC_FALSE;
+            p_sys->b_concert = VLC_FALSE;
 
             return VLC_SUCCESS;
         }
@@ -303,7 +306,17 @@ static int ParseLine ( demux_t *p_demux, char *psz_line )
     {
         psz_bol += sizeof("sgiRtspPort=") - 1;
         p_sys->i_port = (int) strtol( psz_bol, NULL, 0 );
-    }else
+    }
+    else if( !strncasecmp( psz_bol, "sgiSid=", sizeof("sgiSid=") - 1 ) )
+    {
+        psz_bol += sizeof("sgiSid=") - 1;
+        p_sys->i_sid = (int) strtol( psz_bol, NULL, 0 );
+    }
+    else if( !strncasecmp( psz_bol, "DeliveryService=cds", sizeof("DeliveryService=cds") - 1 ) )
+    {
+        p_sys->b_concert = VLC_TRUE;
+    }
+    else
     {
         /* This line isn't really important */
         return 0;
@@ -344,23 +357,23 @@ static int Demux ( demux_t *p_demux )
 
     if( p_sys->psz_mcast_ip )
     {
+        /* Definetly schedules multicast session */
+        /* We don't care if it's live or not */
         char *temp;
 
-        temp = (char *)malloc( sizeof("udp://@000.000.000.000:123456789" ) );
-        sprintf( temp, "udp://@" "%s:%i", p_sys->psz_mcast_ip, p_sys->i_mcast_port );
+        asprintf( &temp, "udp://@" "%s:%i", p_sys->psz_mcast_ip, p_sys->i_mcast_port );
         if( p_sys->psz_uri ) free( p_sys->psz_uri );
         p_sys->psz_uri = strdup( temp );
         free( temp );
     }
-    else if( p_sys->psz_uri == NULL )
+
+    if( p_sys->psz_uri == NULL )
     {
         if( p_sys->psz_server && p_sys->psz_location )
         {
             char *temp;
             
-            temp = (char *)malloc( sizeof("rtsp://" ":" "123456789") +
-                                       strlen( p_sys->psz_server ) + strlen( p_sys->psz_location ) );
-            sprintf( temp, "rtsp://" "%s:%i%s",
+            asprintf( &temp, "rtsp://" "%s:%i%s",
                      p_sys->psz_server, p_sys->i_port > 0 ? p_sys->i_port : 554, p_sys->psz_location );
             
             p_sys->psz_uri = strdup( temp );
@@ -368,6 +381,26 @@ static int Demux ( demux_t *p_demux )
         }
     }
 
+    if( p_sys->b_concert )
+    {
+        /* It's definetly a simulcasted scheduled stream */
+        /* We don't care if it's live or not */
+        char *temp;
+
+        if( p_sys->psz_uri == NULL )
+        {
+            msg_Err( p_demux, "no URI was found" );
+            return -1;
+        }
+        
+        asprintf( &temp, "%s%%3FMeDiAbAsEshowingId=%d%%26MeDiAbAsEconcert%%3FMeDiAbAsE",
+                p_sys->psz_uri, p_sys->i_sid );
+
+        free( p_sys->psz_uri );
+        p_sys->psz_uri = strdup( temp );
+        free( temp );
+    }
+
     p_item = playlist_ItemNew( p_playlist, p_sys->psz_uri,
                       p_sys->psz_name ? p_sys->psz_name : p_sys->psz_uri );
 
@@ -388,7 +421,7 @@ static int Demux ( demux_t *p_demux )
     if( !p_sys->psz_mcast_ip )
     {
         char *psz_option;
-       asprintf( &psz_option, "rtsp-caching=10000" );
+       asprintf( &psz_option, "rtsp-caching=5000" );
        playlist_ItemAddOption( p_item, psz_option );
        free( psz_option );
     }