Commit 6555b580 authored by Rémi Duraffort's avatar Rémi Duraffort

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,6 +185,9 @@ static int Open( vlc_object_t *p_this )
config_ChainParse( p_stream, SOUT_CFG_PREFIX, ppsz_sout_options,
p_stream->p_cfg );
psz_access = var_GetString( p_stream, SOUT_CFG_PREFIX "access" );
if( EMPTY_STR(psz_access) )
{
if( !strcmp( p_stream->psz_name, "http" ) )
{
psz_access = strdup("http");
......@@ -197,16 +200,6 @@ static int Open( vlc_object_t *p_this )
{
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 );
}
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