[vlc-commits] vlm: vlm_New() needs a VLC instance

Rémi Denis-Courmont git at videolan.org
Mon Jun 11 19:58:52 CEST 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Jun 11 20:51:04 2018 +0300| [6a923aeb2c752ae60b4e10068994421b96ced2b1] | committer: Rémi Denis-Courmont

vlm: vlm_New() needs a VLC instance

Don't hide the fact.

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

 include/vlc_vlm.h              | 3 +--
 modules/gui/qt/dialogs/vlm.cpp | 2 +-
 modules/lua/libs/vlm.c         | 2 +-
 src/input/vlm.c                | 6 +++---
 4 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/include/vlc_vlm.h b/include/vlc_vlm.h
index ad323038af..0906065e19 100644
--- a/include/vlc_vlm.h
+++ b/include/vlc_vlm.h
@@ -184,8 +184,7 @@ struct vlm_message_t
 extern "C" {
 #endif
 
-VLC_API vlm_t * vlm_New( vlc_object_t *, const char *path );
-#define vlm_New( a, p ) vlm_New( VLC_OBJECT(a), p )
+VLC_API vlm_t * vlm_New( libvlc_int_t *, const char *path );
 VLC_API void vlm_Delete( vlm_t * );
 VLC_API int vlm_ExecuteCommand( vlm_t *, const char *, vlm_message_t ** );
 VLC_API int vlm_Control( vlm_t *p_vlm, int i_query, ... );
diff --git a/modules/gui/qt/dialogs/vlm.cpp b/modules/gui/qt/dialogs/vlm.cpp
index 0c90f0ce78..b4faebd314 100644
--- a/modules/gui/qt/dialogs/vlm.cpp
+++ b/modules/gui/qt/dialogs/vlm.cpp
@@ -55,7 +55,7 @@
 
 VLMDialog::VLMDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
 {
-    vlm_t *p_vlm = vlm_New( p_intf, NULL );
+    vlm_t *p_vlm = vlm_New( p_intf->obj.libvlc, NULL );
 
     if( !p_vlm )
     {
diff --git a/modules/lua/libs/vlm.c b/modules/lua/libs/vlm.c
index 7b1350cb40..d8ee4d7a34 100644
--- a/modules/lua/libs/vlm.c
+++ b/modules/lua/libs/vlm.c
@@ -53,7 +53,7 @@ static const luaL_Reg vlclua_vlm_reg[] = {
 static int vlclua_vlm_new( lua_State *L )
 {
     vlc_object_t *p_this = vlclua_get_this( L );
-    vlm_t *p_vlm = vlm_New( p_this, NULL );
+    vlm_t *p_vlm = vlm_New( p_this->obj.libvlc, NULL );
     if( !p_vlm )
         return luaL_error( L, "Cannot start VLM." );
 
diff --git a/src/input/vlm.c b/src/input/vlm.c
index 492fca6288..8bb3c35504 100644
--- a/src/input/vlm.c
+++ b/src/input/vlm.c
@@ -111,13 +111,13 @@ static int InputEvent( vlc_object_t *p_this, char const *psz_cmd,
 
 static vlc_mutex_t vlm_mutex = VLC_STATIC_MUTEX;
 
-#undef vlm_New
 /*****************************************************************************
  * vlm_New:
  *****************************************************************************/
-vlm_t *vlm_New ( vlc_object_t *p_this, const char *psz_vlmconf )
+vlm_t *vlm_New( libvlc_int_t *libvlc, const char *psz_vlmconf )
 {
-    vlm_t *p_vlm = NULL, **pp_vlm = &(libvlc_priv (p_this->obj.libvlc)->p_vlm);
+    vlm_t *p_vlm = NULL, **pp_vlm = &(libvlc_priv(libvlc)->p_vlm);
+    vlc_object_t *p_this = VLC_OBJECT(libvlc);
 
     /* Avoid multiple creation */
     vlc_mutex_lock( &vlm_mutex );



More information about the vlc-commits mailing list