byte_t *p_peek;
int i_size;
- p_demux->pf_demux = Demux;
- p_demux->pf_control = Control;
- p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) );
- p_sys->psz_uri = NULL;
- p_sys->psz_server = NULL;
- p_sys->psz_location = NULL;
- p_sys->psz_name = NULL;
- p_sys->psz_user = NULL;
- p_sys->psz_password = NULL;
- p_sys->psz_mcast_ip = NULL;
- p_sys->i_mcast_port = 0;
- p_sys->i_packet_size = 0;
- p_sys->i_duration = (mtime_t)0;
- p_sys->i_port = 0;
-
-
/* Lets check the content to see if this is a sgi mediabase file */
i_size = stream_Peek( p_demux->s, &p_peek, MAX_LINE );
i_size -= sizeof("sgiNameServerHost=") - 1;
- if ( i_size > 0 ) {
- while ( i_size
- && strncasecmp( p_peek, "sgiNameServerHost=", sizeof("sgiNameServerHost=") - 1 ) )
+ if ( i_size > 0 )
+ {
+ while ( i_size && strncasecmp( p_peek, "sgiNameServerHost=",
+ sizeof("sgiNameServerHost=") - 1 ) )
{
p_peek++;
i_size--;
}
- if ( !strncasecmp( p_peek, "sgiNameServerHost=", sizeof("sgiNameServerHost=") -1 ) )
+ if ( !strncasecmp( p_peek, "sgiNameServerHost=",
+ sizeof("sgiNameServerHost=") -1 ) )
{
+ p_demux->pf_demux = Demux;
+ p_demux->pf_control = Control;
+
+ p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) );
+ p_sys->psz_uri = NULL;
+ p_sys->psz_server = NULL;
+ p_sys->psz_location = NULL;
+ p_sys->psz_name = NULL;
+ p_sys->psz_user = NULL;
+ p_sys->psz_password = NULL;
+ p_sys->psz_mcast_ip = NULL;
+ p_sys->i_mcast_port = 0;
+ p_sys->i_packet_size = 0;
+ p_sys->i_duration = 0;
+ p_sys->i_port = 0;
+
return VLC_SUCCESS;
}
}
{
char *temp;
- temp = (char *)malloc( sizeof("udp/ts2://@000.000.000.000:123456789" ) );
- sprintf( temp, "udp/ts2://@" "%s:%i", p_sys->psz_mcast_ip, p_sys->i_mcast_port );
+ 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 );
if( p_sys->psz_uri ) free( p_sys->psz_uri );
p_sys->psz_uri = strdup( temp );
free( temp );
if( p_sys->i_packet_size && p_sys->psz_mcast_ip )
{
- char *psz_option = (char *) malloc( 20 );
+ char *psz_option;
p_sys->i_packet_size += 1000;
- sprintf( psz_option, "mtu=%i", p_sys->i_packet_size );
+ asprintf( &psz_option, "mtu=%i", p_sys->i_packet_size );
playlist_ItemAddOption( p_item, psz_option );
free( psz_option );
}