Commit de6ad25b authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* sgimb.c: backport of r9300 to trunk

parent 9aadab26
...@@ -135,6 +135,7 @@ struct demux_sys_t ...@@ -135,6 +135,7 @@ struct demux_sys_t
mtime_t i_duration; /* sgiDuration= */ mtime_t i_duration; /* sgiDuration= */
int i_port; /* sgiRtspPort= */ int i_port; /* sgiRtspPort= */
int i_sid; /* sgiSid= */ int i_sid; /* sgiSid= */
vlc_bool_t b_concert; /* DeliveryService=cds */
vlc_bool_t b_rtsp_kasenna; /* kasenna style RTSP */ vlc_bool_t b_rtsp_kasenna; /* kasenna style RTSP */
}; };
...@@ -180,7 +181,9 @@ static int Activate( vlc_object_t * p_this ) ...@@ -180,7 +181,9 @@ static int Activate( vlc_object_t * p_this )
p_sys->i_packet_size = 0; p_sys->i_packet_size = 0;
p_sys->i_duration = 0; p_sys->i_duration = 0;
p_sys->i_port = 0; p_sys->i_port = 0;
p_sys->i_sid = 0;
p_sys->b_rtsp_kasenna = VLC_FALSE; p_sys->b_rtsp_kasenna = VLC_FALSE;
p_sys->b_concert = VLC_FALSE;
return VLC_SUCCESS; return VLC_SUCCESS;
} }
...@@ -303,7 +306,17 @@ static int ParseLine ( demux_t *p_demux, char *psz_line ) ...@@ -303,7 +306,17 @@ static int ParseLine ( demux_t *p_demux, char *psz_line )
{ {
psz_bol += sizeof("sgiRtspPort=") - 1; psz_bol += sizeof("sgiRtspPort=") - 1;
p_sys->i_port = (int) strtol( psz_bol, NULL, 0 ); 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 */ /* This line isn't really important */
return 0; return 0;
...@@ -344,23 +357,23 @@ static int Demux ( demux_t *p_demux ) ...@@ -344,23 +357,23 @@ static int Demux ( demux_t *p_demux )
if( p_sys->psz_mcast_ip ) if( p_sys->psz_mcast_ip )
{ {
/* Definetly schedules multicast session */
/* We don't care if it's live or not */
char *temp; char *temp;
temp = (char *)malloc( sizeof("udp://@000.000.000.000:123456789" ) ); asprintf( &temp, "udp://@" "%s:%i", p_sys->psz_mcast_ip, p_sys->i_mcast_port );
sprintf( temp, "udp://@" "%s:%i", p_sys->psz_mcast_ip, p_sys->i_mcast_port );
if( p_sys->psz_uri ) free( p_sys->psz_uri ); if( p_sys->psz_uri ) free( p_sys->psz_uri );
p_sys->psz_uri = strdup( temp ); p_sys->psz_uri = strdup( temp );
free( 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 ) if( p_sys->psz_server && p_sys->psz_location )
{ {
char *temp; char *temp;
temp = (char *)malloc( sizeof("rtsp://" ":" "123456789") + asprintf( &temp, "rtsp://" "%s:%i%s",
strlen( p_sys->psz_server ) + strlen( p_sys->psz_location ) );
sprintf( 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_server, p_sys->i_port > 0 ? p_sys->i_port : 554, p_sys->psz_location );
p_sys->psz_uri = strdup( temp ); p_sys->psz_uri = strdup( temp );
...@@ -368,6 +381,26 @@ static int Demux ( demux_t *p_demux ) ...@@ -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_item = playlist_ItemNew( p_playlist, p_sys->psz_uri,
p_sys->psz_name ? p_sys->psz_name : 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 ) ...@@ -388,7 +421,7 @@ static int Demux ( demux_t *p_demux )
if( !p_sys->psz_mcast_ip ) if( !p_sys->psz_mcast_ip )
{ {
char *psz_option; char *psz_option;
asprintf( &psz_option, "rtsp-caching=10000" ); asprintf( &psz_option, "rtsp-caching=5000" );
playlist_ItemAddOption( p_item, psz_option ); playlist_ItemAddOption( p_item, psz_option );
free( psz_option ); free( psz_option );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment