[vlc-devel] commit: Merge module_release and module_Put ( Rémi Denis-Courmont )
git version control
git at videolan.org
Sun Sep 21 12:27:26 CEST 2008
vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sun Sep 21 13:18:34 2008 +0300| [2ba61deea6a7a177eedee4e66c78b51a7677f942] | committer: Rémi Denis-Courmont
Merge module_release and module_Put
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2ba61deea6a7a177eedee4e66c78b51a7677f942
---
include/vlc_modules.h | 3 +-
.../gui/qt4/components/complete_preferences.cpp | 2 +-
modules/gui/qt4/components/extended_panels.cpp | 4 +-
modules/gui/qt4/components/open_panels.cpp | 2 +-
modules/gui/qt4/components/preferences_widgets.cpp | 2 +-
modules/gui/wxwidgets/dialogs/open.cpp | 8 ++--
modules/gui/wxwidgets/dialogs/preferences.cpp | 2 +-
src/libvlccore.sym | 3 +-
src/modules/modules.c | 34 +++++++------------
src/modules/modules.h | 11 ------
10 files changed, 27 insertions(+), 44 deletions(-)
diff --git a/include/vlc_modules.h b/include/vlc_modules.h
index 7d96a35..5b3bb42 100644
--- a/include/vlc_modules.h
+++ b/include/vlc_modules.h
@@ -39,11 +39,12 @@ VLC_EXPORT( bool, __module_Exists, ( vlc_object_t *, const char * ) );
#define module_Find(a,b) __module_Find(VLC_OBJECT(a),b)
VLC_EXPORT( module_t *, __module_Find, ( vlc_object_t *, const char * ) );
-VLC_EXPORT( void, module_Put, ( module_t *module ) );
VLC_EXPORT( module_config_t *, module_GetConfig, ( const module_t *, unsigned * ) );
VLC_EXPORT( void, module_PutConfig, ( module_config_t * ) );
+VLC_EXPORT( module_t *, module_hold, (module_t *module) );
+VLC_EXPORT( void, module_release, (module_t *module) );
VLC_EXPORT( void, module_list_free, (module_t **) );
VLC_EXPORT( module_t **, module_list_get, (size_t *n) );
diff --git a/modules/gui/qt4/components/complete_preferences.cpp b/modules/gui/qt4/components/complete_preferences.cpp
index 6967290..f543a82 100644
--- a/modules/gui/qt4/components/complete_preferences.cpp
+++ b/modules/gui/qt4/components/complete_preferences.cpp
@@ -496,7 +496,7 @@ AdvPrefsPanel::AdvPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
layout->addWidget( box, i_line, 0, 1, -1 );
}
- module_Put( p_module );
+ module_release (p_module);
scrolled_area->setSizePolicy( QSizePolicy::Preferred,QSizePolicy::Fixed );
scrolled_area->setLayout( layout );
diff --git a/modules/gui/qt4/components/extended_panels.cpp b/modules/gui/qt4/components/extended_panels.cpp
index ab69ced..2843b3b 100644
--- a/modules/gui/qt4/components/extended_panels.cpp
+++ b/modules/gui/qt4/components/extended_panels.cpp
@@ -271,11 +271,11 @@ void ExtVideo::ChangeVFiltersString( char *psz_name, bool b_add )
}
else
{
- module_Put( p_obj );
+ module_release (p_obj);
msg_Err( p_intf, "Unknown video filter type." );
return;
}
- module_Put( p_obj );
+ module_release (p_obj);
psz_string = config_GetPsz( p_intf, psz_filter_type );
diff --git a/modules/gui/qt4/components/open_panels.cpp b/modules/gui/qt4/components/open_panels.cpp
index acabe6f..7342a5f 100644
--- a/modules/gui/qt4/components/open_panels.cpp
+++ b/modules/gui/qt4/components/open_panels.cpp
@@ -1214,6 +1214,6 @@ void CaptureOpenPanel::advancedDialog()
}
delete adv;
module_PutConfig( p_config );
- module_Put( p_module );
+ module_release (p_module);
}
diff --git a/modules/gui/qt4/components/preferences_widgets.cpp b/modules/gui/qt4/components/preferences_widgets.cpp
index 4f3757a..22337fa 100644
--- a/modules/gui/qt4/components/preferences_widgets.cpp
+++ b/modules/gui/qt4/components/preferences_widgets.cpp
@@ -1196,7 +1196,7 @@ void KeySelectorControl::finish()
}
}
module_PutConfig (p_config);
- module_Put (p_main);
+ module_release (p_main);
table->resizeColumnToContents( 0 );
diff --git a/modules/gui/wxwidgets/dialogs/open.cpp b/modules/gui/wxwidgets/dialogs/open.cpp
index 7ef0197..f876672 100644
--- a/modules/gui/wxwidgets/dialogs/open.cpp
+++ b/modules/gui/wxwidgets/dialogs/open.cpp
@@ -515,7 +515,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
input_tab_array.Add( autopanel );
notebook->AddPage( autopanel, wxU( module_GetName(p_module, 0) ),
i_access_method == CAPTURE_ACCESS );
- module_Put( p_module );
+ module_release (p_module);
}
p_module = module_Find( VLC_OBJECT(p_intf), "pvr" );
@@ -526,7 +526,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
input_tab_array.Add( autopanel );
notebook->AddPage( autopanel, wxU( module_GetName(p_module, 0) ),
i_access_method == CAPTURE_ACCESS );
- module_Put( p_module );
+ module_release (p_module);
}
p_module = module_Find( VLC_OBJECT(p_intf), "dvb" );
@@ -537,7 +537,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
input_tab_array.Add( autopanel );
notebook->AddPage( autopanel, wxU( module_GetName(p_module, 0) ),
i_access_method == CAPTURE_ACCESS );
- module_Put( p_module );
+ module_release (p_module);
}
p_module = module_Find( VLC_OBJECT(p_intf), "dshow" );
@@ -548,7 +548,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
input_tab_array.Add( autopanel );
notebook->AddPage( autopanel, wxU( module_GetName(p_module, 0) ),
i_access_method == CAPTURE_ACCESS );
- module_Put( p_module );
+ module_release (p_module);
}
/* Update Disc panel */
diff --git a/modules/gui/wxwidgets/dialogs/preferences.cpp b/modules/gui/wxwidgets/dialogs/preferences.cpp
index edf7de7..6137848 100644
--- a/modules/gui/wxwidgets/dialogs/preferences.cpp
+++ b/modules/gui/wxwidgets/dialogs/preferences.cpp
@@ -1033,7 +1033,7 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
if( config_data->i_type == TYPE_MODULE )
{
- module_Put( p_module );
+ module_release (p_module);
}
else
{
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 466adfb..3d52504 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -211,12 +211,13 @@ module_GetHelp
__module_GetModulesNamesForCapability
module_GetName
module_GetObjName
+module_hold
module_IsCapable
module_list_free
module_list_get
__module_Need
-module_Put
module_PutConfig
+module_release
__module_Unneed
__msg_Dbg
__msg_DisableObjectPrinting
diff --git a/src/modules/modules.c b/src/modules/modules.c
index a1a3bdd..c73c97d 100644
--- a/src/modules/modules.c
+++ b/src/modules/modules.c
@@ -325,6 +325,17 @@ const char *module_GetHelp( const module_t *m )
return m->psz_help;
}
+module_t *module_hold (module_t *m)
+{
+ vlc_hold (&m->vlc_gc_data);
+ return m;
+}
+
+void module_release (module_t *m)
+{
+ vlc_release (&m->vlc_gc_data);
+}
+
/**
* Frees the flat list of VLC modules.
* @param list list obtained by module_list_get
@@ -749,19 +760,6 @@ module_t *__module_Find( vlc_object_t *p_this, const char * psz_name )
return module;
}
-
-/**
- * Release a module_t pointer from module_Find().
- *
- * \param module the module to release
- * \return nothing
- */
-void module_Put( module_t *module )
-{
- module_release( module );
-}
-
-
/**
* Tell if a module exists and release it in thic case
*
@@ -773,14 +771,8 @@ bool __module_Exists( vlc_object_t *p_this, const char * psz_name )
{
module_t *p_module = __module_Find( p_this, psz_name );
if( p_module )
- {
- module_Put( p_module );
- return true;
- }
- else
- {
- return false;
- }
+ module_release (p_module);
+ return true != NULL;
}
/**
diff --git a/src/modules/modules.h b/src/modules/modules.h
index 2f9de5b..baafe45 100644
--- a/src/modules/modules.h
+++ b/src/modules/modules.h
@@ -149,17 +149,6 @@ struct module_t
bool b_loaded; /* Set to true if the dll is loaded */
};
-static inline module_t *module_hold (module_t *m)
-{
- vlc_hold (&m->vlc_gc_data);
- return m;
-}
-
-static inline void module_release (module_t *m)
-{
- vlc_release (&m->vlc_gc_data);
-}
-
#define module_InitBank(a) __module_InitBank(VLC_OBJECT(a))
void __module_InitBank ( vlc_object_t * );
#define module_LoadBuiltins(a) __module_LoadBuiltins(VLC_OBJECT(a))
More information about the vlc-devel
mailing list