[vlc-devel] commit: Remove vlc_global() ( Rémi Denis-Courmont )
git version control
git at videolan.org
Sun Sep 28 19:30:36 CEST 2008
vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sun Sep 28 20:33:54 2008 +0300| [80cb294832cf77b8440957d75d24cae2ec853d0c] | committer: Rémi Denis-Courmont
Remove vlc_global()
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=80cb294832cf77b8440957d75d24cae2ec853d0c
---
src/libvlc.h | 1 -
src/misc/threads.c | 24 ++++++++++++++++++------
src/misc/variables.c | 19 -------------------
src/misc/win32_specific.c | 2 +-
4 files changed, 19 insertions(+), 27 deletions(-)
diff --git a/src/libvlc.h b/src/libvlc.h
index fbf1a02..6ff2e23 100644
--- a/src/libvlc.h
+++ b/src/libvlc.h
@@ -146,7 +146,6 @@ __vlc_custom_create (vlc_object_t *p_this, size_t i_size, int i_type,
*/
extern module_bank_t *p_module_bank;
-vlc_object_t *vlc_global (void);
extern char *psz_vlcpath;
/**
diff --git a/src/misc/threads.c b/src/misc/threads.c
index 68472bb..3a784a0 100644
--- a/src/misc/threads.c
+++ b/src/misc/threads.c
@@ -59,12 +59,6 @@ static vlc_threadvar_t cancel_key;
*/
static vlc_object_t *p_root;
-vlc_object_t *vlc_global( void )
-{
- assert( i_initializations > 0 );
- return p_root;
-}
-
#ifdef HAVE_EXECINFO_H
# include <execinfo.h>
#endif
@@ -1110,3 +1104,21 @@ void vlc_control_cancel (int cmd, ...)
va_end (ap);
#endif
}
+
+
+#undef var_AcquireMutex
+/**
+ * Finds a process-wide mutex, creates it if needed, and locks it.
+ * Unlock with vlc_mutex_unlock().
+ */
+vlc_mutex_t *var_AcquireMutex( const char *name )
+{
+ vlc_value_t val;
+
+ if( var_Create( p_root, name, VLC_VAR_MUTEX ) )
+ return NULL;
+
+ var_Get( p_root, name, &val );
+ vlc_mutex_lock( val.p_address );
+ return val.p_address;
+}
diff --git a/src/misc/variables.c b/src/misc/variables.c
index 37fcd79..4a6d8e9 100644
--- a/src/misc/variables.c
+++ b/src/misc/variables.c
@@ -849,25 +849,6 @@ int __var_Get( vlc_object_t *p_this, const char *psz_name, vlc_value_t *p_val )
}
-#undef var_AcquireMutex
-/**
- * Finds a process-wide mutex, creates it if needed, and locks it.
- * Unlock with vlc_mutex_unlock().
- */
-vlc_mutex_t *var_AcquireMutex( const char *name )
-{
- vlc_object_t *p_global = vlc_global();
- vlc_value_t val;
-
- if( var_Create( p_global, name, VLC_VAR_MUTEX ) )
- return NULL;
-
- var_Get( p_global, name, &val );
- vlc_mutex_lock( val.p_address );
- return val.p_address;
-}
-
-
/**
* Register a callback in a variable
*
diff --git a/src/misc/win32_specific.c b/src/misc/win32_specific.c
index b89eabf..8daf1fa 100644
--- a/src/misc/win32_specific.c
+++ b/src/misc/win32_specific.c
@@ -369,7 +369,7 @@ LRESULT CALLBACK WMCOPYWNDPROC( HWND hwnd, UINT uMsg, WPARAM wParam,
void system_End( libvlc_int_t *p_this )
{
HWND ipcwindow;
- if( p_this && vlc_global() )
+ if( p_this )
{
free( psz_vlcpath );
psz_vlcpath = NULL;
More information about the vlc-devel
mailing list