[vlc-devel] commit: Add support for config chain for interface modules ( Antoine Cellerier )

git version control git at videolan.org
Mon Jan 19 23:41:12 CET 2009


vlc | branch: master | Antoine Cellerier <dionoea at videolan.org> | Mon Jan 19 23:40:11 2009 +0100| [b7ccccfb9c01a7a0eeec171dde420e5a3ae6a9a7] | committer: Antoine Cellerier 

Add support for config chain for interface modules

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

 include/vlc_interface.h   |    2 ++
 include/vlc_plugin.h      |    4 ++--
 src/interface/interface.c |   12 ++++++++++--
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/include/vlc_interface.h b/include/vlc_interface.h
index f24633b..056167a 100644
--- a/include/vlc_interface.h
+++ b/include/vlc_interface.h
@@ -67,6 +67,8 @@ struct intf_thread_t
                                intf_dialog_args_t * );
 
     vlc_mutex_t  change_lock;
+
+    config_chain_t *p_cfg;
 };
 
 /** \brief Arguments passed to a dialogs provider
diff --git a/include/vlc_plugin.h b/include/vlc_plugin.h
index 0d2542f..a1e550d 100644
--- a/include/vlc_plugin.h
+++ b/include/vlc_plugin.h
@@ -132,8 +132,8 @@ enum vlc_config_properties
 /**
  * Current plugin ABI version
  */
-# define MODULE_SYMBOL 1_0_0c
-# define MODULE_SUFFIX "__1_0_0c"
+# define MODULE_SYMBOL 1_0_0d
+# define MODULE_SUFFIX "__1_0_0d"
 
 /*****************************************************************************
  * Add a few defines. You do not want to read this section. Really.
diff --git a/src/interface/interface.c b/src/interface/interface.c
index 6dc2382..9392d0d 100644
--- a/src/interface/interface.c
+++ b/src/interface/interface.c
@@ -69,6 +69,7 @@ static void intf_Destroy( vlc_object_t *obj )
         module_unneed( p_intf, p_intf->p_module );
 
     free( p_intf->psz_intf );
+    config_ChainDestroy( p_intf->p_cfg );
     vlc_mutex_destroy( &p_intf->change_lock );
 }
 
@@ -94,8 +95,15 @@ intf_thread_t* __intf_Create( vlc_object_t *p_this, const char *psz_module )
 #endif
 
     /* Choose the best module */
-    p_intf->psz_intf = strdup( psz_module );
-    p_intf->p_module = module_need( p_intf, "interface", psz_module, true );
+    p_intf->p_cfg = NULL;
+    char *psz_parser = *psz_module == '$'
+                     ? var_CreateGetString(p_intf,psz_module+1)
+                     : strdup( psz_module );
+    char *psz_tmp = config_ChainCreate( &p_intf->psz_intf, &p_intf->p_cfg,
+                                        psz_parser );
+    free( psz_tmp );
+    free( psz_parser );
+    p_intf->p_module = module_need( p_intf, "interface", p_intf->psz_intf, true );
 
     if( p_intf->p_module == NULL )
     {




More information about the vlc-devel mailing list