From edf32d6b5d7857c87275965f2e84417899ce264d Mon Sep 17 00:00:00 2001 From: basos G Date: Sun, 11 Jan 2009 04:51:27 +0200 Subject: [PATCH 1/1] Variable inheritance hints Added a comment to describe inheritable variables Added debug messages to get clues about variable inheritance final source Signed-off-by: Laurent Aimar --- include/vlc_variables.h | 2 ++ src/misc/variables.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/vlc_variables.h b/include/vlc_variables.h index 082660f873..79c95e3ac0 100644 --- a/include/vlc_variables.h +++ b/include/vlc_variables.h @@ -61,6 +61,8 @@ #define VLC_VAR_ISCOMMAND 0x2000 /** Creation flag */ +/* If the variable is not found on the current module + search all parents and finally module config until found */ #define VLC_VAR_DOINHERIT 0x8000 /**@}*/ diff --git a/src/misc/variables.c b/src/misc/variables.c index dc0e8e6fef..26d79d0ec9 100644 --- a/src/misc/variables.c +++ b/src/misc/variables.c @@ -1384,7 +1384,7 @@ static int InheritValue( vlc_object_t *p_this, const char *psz_name, int i_var; variable_t *p_var; - if( p_this->p_parent || ( p_this->p_libvlc && p_this != p_this->p_libvlc ) ) + if( p_this->p_parent || ( p_this->p_libvlc && p_this != (vlc_object_t*) p_this->p_libvlc ) ) { vlc_object_internals_t *p_priv; @@ -1406,6 +1406,8 @@ static int InheritValue( vlc_object_t *p_this, const char *psz_name, /* Duplicate value if needed */ p_var->ops->pf_dup( p_val ); + msg_Dbg( p_this, "Inherited value for var %s from object %s", psz_name ? : "(null)", + p_this->psz_object_name ? : "(Unknown)" ) ; return VLC_SUCCESS; } else if ( p_this->p_parent ) /* We are still not there */ @@ -1460,9 +1462,11 @@ static int InheritValue( vlc_object_t *p_this, const char *psz_name, break; } default: + msg_Warn( p_this, "Could not inherit value for var %s from config. Invalid Type", psz_name ) ; return VLC_ENOOBJ; break; } + msg_Dbg( p_this, "Inherited value for var %s from config", psz_name ) ; return VLC_SUCCESS; } -- 2.39.2