[vlc-devel] commit: Variable inheritance hints (basos G )
git version control
git at videolan.org
Mon Feb 2 21:27:58 CET 2009
vlc | branch: master | basos G <noxelia 4t gmail , com> | Sun Jan 11 04:51:27 2009 +0200| [edf32d6b5d7857c87275965f2e84417899ce264d] | committer: Laurent Aimar
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 <fenrir at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=edf32d6b5d7857c87275965f2e84417899ce264d
---
include/vlc_variables.h | 2 ++
src/misc/variables.c | 6 +++++-
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/include/vlc_variables.h b/include/vlc_variables.h
index 082660f..79c95e3 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 dc0e8e6..26d79d0 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;
}
More information about the vlc-devel
mailing list