]> git.sesse.net Git - vlc/commitdiff
Variable inheritance hints
authorbasos G <noxelia 4t gmail , com>
Sun, 11 Jan 2009 02:51:27 +0000 (04:51 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Mon, 2 Feb 2009 20:09:32 +0000 (21:09 +0100)
Added a comment to describe inheritable variables
Added debug messages to get clues about variable
inheritance final source

Signed-off-by: Laurent Aimar <fenrir@videolan.org>
include/vlc_variables.h
src/misc/variables.c

index 082660f8735c76ae1984746d85164d9ab7458e6e..79c95e3ac0de99acb9ce6f9bf91892e5991530ec 100644 (file)
@@ -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
 /**@}*/
 
index dc0e8e6fefaaa91e0c36b5359995e30b2fa39e11..26d79d0ec92fc23dfd311f0172412ae0362c6a77 100644 (file)
@@ -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;
 }