Commit 6555b580 authored by ivoire's avatar ivoire
Browse files

sout_std: imporve logic (and save a malloc/free)

parent e7254d38
......@@ -170,7 +170,7 @@ static int Open( vlc_object_t *p_this )
sout_stream_sys_t *p_sys;
char *psz_mux;
char *psz_access=NULL;
char *psz_access;
char *psz_url=NULL;
char *psz_bind;
char *psz_path;
......@@ -185,28 +185,21 @@ static int Open( vlc_object_t *p_this )
config_ChainParse( p_stream, SOUT_CFG_PREFIX, ppsz_sout_options,
p_stream->p_cfg );
if( !strcmp( p_stream->psz_name, "http" ) )
psz_access = var_GetString( p_stream, SOUT_CFG_PREFIX "access" );
if( EMPTY_STR(psz_access) )
{
psz_access = strdup("http");
}
else if (!strcmp (p_stream->psz_name, "udp"))
{
psz_access = strdup("udp");
}
else if (!strcmp (p_stream->psz_name, "file"))
{
psz_access = strdup("file");
}
var_Get( p_stream, SOUT_CFG_PREFIX "access", &val );
if( *val.psz_string )
{
free( psz_access );
psz_access = val.psz_string;
}
else
{
free( val.psz_string );
if( !strcmp( p_stream->psz_name, "http" ) )
{
psz_access = strdup("http");
}
else if (!strcmp (p_stream->psz_name, "udp"))
{
psz_access = strdup("udp");
}
else if (!strcmp (p_stream->psz_name, "file"))
{
psz_access = strdup("file");
}
}
psz_mux = var_GetNonEmptyString( p_stream, SOUT_CFG_PREFIX "mux" );
......
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