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