]> git.sesse.net Git - vlc/commitdiff
Add var_InheritAddress()
authorRémi Denis-Courmont <remi@remlab.net>
Fri, 9 Jul 2010 14:50:50 +0000 (17:50 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 10 Jul 2010 09:50:57 +0000 (12:50 +0300)
Returns NULL if the variable cannot be inherited - pointers can never
be found in the configuration.

include/vlc_variables.h
src/misc/variables.c

index b1c2b394e8614967320ebda2a3f3f47eda39aaf5..2cf2d836341935b23913ee92295e227ce5cfec96 100644 (file)
@@ -713,6 +713,16 @@ static inline mtime_t var_InheritTime( vlc_object_t *obj, const char *name )
 }
 #define var_InheritTime(o, n) var_InheritTime(VLC_OBJECT(o), n)
 
+static inline void *var_InheritAddress( vlc_object_t *obj, const char *name )
+{
+    vlc_value_t val;
+
+    if( var_Inherit( obj, name, VLC_VAR_ADDRESS, &val ) )
+        val.p_address = NULL;
+    return val.p_address;
+}
+#define var_InheritAddress(o, n) var_InheritAddress(VLC_OBECT(o), n)
+
 VLC_EXPORT( int, var_InheritURational, ( vlc_object_t *, unsigned *num, unsigned *den, const char *var ) );
 #define var_InheritURational(a,b,c,d) var_InheritURational(VLC_OBJECT(a), b, c, d)
 
index 6f3e901cc9bc59e6cc3d590a43bceac8668d3957..9374f3e798b76388117fcc9b4aa1552a609a0206 100644 (file)
@@ -1225,6 +1225,8 @@ int var_Inherit( vlc_object_t *p_this, const char *psz_name, int i_type,
         case VLC_VAR_BOOL:
             p_val->b_bool = config_GetInt( p_this, psz_name );
             break;
+        case VLC_VAR_ADDRESS:
+            return VLC_ENOOBJ;
         default:
             msg_Warn( p_this, "Could not inherit value for var %s "
                               "from config. Invalid Type", psz_name );