Commit 9db69040 authored by Laurent Aimar's avatar Laurent Aimar

* stream_output: added bool support (untested).

parent a31d6d62
...@@ -947,6 +947,7 @@ void __sout_ParseCfg( vlc_object_t *p_this, char *psz_prefix, const char **ppsz_ ...@@ -947,6 +947,7 @@ void __sout_ParseCfg( vlc_object_t *p_this, char *psz_prefix, const char **ppsz_
while( cfg ) while( cfg )
{ {
vlc_value_t val; vlc_value_t val;
vlc_bool_t b_yes = VLC_TRUE;
if( cfg->psz_name == NULL || *cfg->psz_name == '\0' ) if( cfg->psz_name == NULL || *cfg->psz_name == '\0' )
{ {
...@@ -971,9 +972,20 @@ void __sout_ParseCfg( vlc_object_t *p_this, char *psz_prefix, const char **ppsz_ ...@@ -971,9 +972,20 @@ void __sout_ParseCfg( vlc_object_t *p_this, char *psz_prefix, const char **ppsz_
/* get the type of the variable */ /* get the type of the variable */
i_type = config_GetType( p_this, psz_name ); i_type = config_GetType( p_this, psz_name );
if( !i_type ) if( !i_type && !strncmp( cfg->psz_name, "no", 2 ) )
{ {
/* TODO check for no, no- */ free( psz_name );
b_yes = VLC_FALSE;
if( !strncmp( cfg->psz_name, "no-", 3 ) )
{
asprintf( &psz_name, "%s%s", psz_prefix, cfg->psz_name + 3 );
}
else
{
asprintf( &psz_name, "%s%s", psz_prefix, cfg->psz_name + 2 );
}
i_type = config_GetType( p_this, psz_name );
} }
if( !i_type ) if( !i_type )
...@@ -989,6 +1001,9 @@ void __sout_ParseCfg( vlc_object_t *p_this, char *psz_prefix, const char **ppsz_ ...@@ -989,6 +1001,9 @@ void __sout_ParseCfg( vlc_object_t *p_this, char *psz_prefix, const char **ppsz_
switch( i_type ) switch( i_type )
{ {
case VLC_VAR_BOOL:
val.b_bool = b_yes;
break;
case VLC_VAR_INTEGER: case VLC_VAR_INTEGER:
val.i_int = atoi( cfg->psz_value ? cfg->psz_value : "0" ); val.i_int = atoi( cfg->psz_value ? cfg->psz_value : "0" );
break; break;
...@@ -998,8 +1013,6 @@ void __sout_ParseCfg( vlc_object_t *p_this, char *psz_prefix, const char **ppsz_ ...@@ -998,8 +1013,6 @@ void __sout_ParseCfg( vlc_object_t *p_this, char *psz_prefix, const char **ppsz_
case VLC_VAR_STRING: case VLC_VAR_STRING:
val.psz_string = cfg->psz_value; val.psz_string = cfg->psz_value;
break; break;
case VLC_VAR_BOOL:
default: default:
msg_Warn( p_this, "unhandled config var type" ); msg_Warn( p_this, "unhandled config var type" );
memset( &val, 0, sizeof( vlc_value_t ) ); memset( &val, 0, sizeof( vlc_value_t ) );
......
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