[vlc-commits] commit: Add var_InheritAddress() ( Rémi Denis-Courmont )

git at videolan.org git at videolan.org
Sun Jul 11 15:29:19 CEST 2010


vlc/vlc-1.1 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jul 11 16:25:30 2010 +0300| [06b5fc1b44294ab4cec960dd6d77844d2bd5d1f5] | committer: Rémi Denis-Courmont 

Add var_InheritAddress()

Returns NULL if the variable cannot be inherited - pointers can never
be found in the configuration.
(cherry picked from commit fd907c9abaa6304442ced84809bdb53600c922ca)

Conflicts:

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

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=06b5fc1b44294ab4cec960dd6d77844d2bd5d1f5
---

 include/vlc_variables.h |   10 ++++++++++
 src/misc/variables.c    |    2 ++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/include/vlc_variables.h b/include/vlc_variables.h
index 4a0de14..258ed05 100644
--- a/include/vlc_variables.h
+++ b/include/vlc_variables.h
@@ -712,6 +712,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_OBJECT(o), n)
+
 #define var_GetInteger(a,b)   var_GetInteger( VLC_OBJECT(a),b)
 #define var_GetBool(a,b)   var_GetBool( VLC_OBJECT(a),b)
 #define var_GetTime(a,b)   var_GetTime( VLC_OBJECT(a),b)
diff --git a/src/misc/variables.c b/src/misc/variables.c
index 1cbfefa..59d5cc5 100644
--- a/src/misc/variables.c
+++ b/src/misc/variables.c
@@ -1327,6 +1327,8 @@ int var_Inherit( vlc_object_t *p_this, const char *psz_name, int i_type,
             free( psz_orig );
             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 );



More information about the vlc-commits mailing list