Commit ef04b504 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

We know where VLM is, no need to find it.

Now we can remove the VLM object type.
parent 7db96bf8
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
#define VLC_OBJECT_PACKETIZER (-13) #define VLC_OBJECT_PACKETIZER (-13)
#define VLC_OBJECT_ENCODER (-14) #define VLC_OBJECT_ENCODER (-14)
#define VLC_OBJECT_DIALOGS (-15) #define VLC_OBJECT_DIALOGS (-15)
#define VLC_OBJECT_VLM (-16)
#define VLC_OBJECT_ANNOUNCE (-17) #define VLC_OBJECT_ANNOUNCE (-17)
#define VLC_OBJECT_DEMUX (-18) #define VLC_OBJECT_DEMUX (-18)
#define VLC_OBJECT_ACCESS (-19) #define VLC_OBJECT_ACCESS (-19)
......
...@@ -119,7 +119,6 @@ static int vlc_object_type_from_string( const char *psz_name ) ...@@ -119,7 +119,6 @@ static int vlc_object_type_from_string( const char *psz_name )
{ VLC_OBJECT_PACKETIZER, "packetizer" }, { VLC_OBJECT_PACKETIZER, "packetizer" },
{ VLC_OBJECT_ENCODER, "encoder" }, { VLC_OBJECT_ENCODER, "encoder" },
{ VLC_OBJECT_DIALOGS, "dialogs" }, { VLC_OBJECT_DIALOGS, "dialogs" },
{ VLC_OBJECT_VLM, "vlm" },
{ VLC_OBJECT_ANNOUNCE, "announce" }, { VLC_OBJECT_ANNOUNCE, "announce" },
{ VLC_OBJECT_DEMUX, "demux" }, { VLC_OBJECT_DEMUX, "demux" },
{ VLC_OBJECT_ACCESS, "access" }, { VLC_OBJECT_ACCESS, "access" },
......
...@@ -56,7 +56,7 @@ int vlclua_vlm_new( lua_State *L ) ...@@ -56,7 +56,7 @@ int vlclua_vlm_new( lua_State *L )
int vlclua_vlm_delete( lua_State *L ) int vlclua_vlm_delete( lua_State *L )
{ {
vlm_t *p_vlm = (vlm_t*)vlclua_checkobject( L, 1, VLC_OBJECT_VLM ); vlm_t *p_vlm = (vlm_t*)vlclua_checkobject( L, 1, VLC_OBJECT_GENERIC );
vlm_Delete( p_vlm ); vlm_Delete( p_vlm );
return 0; return 0;
} }
...@@ -88,7 +88,7 @@ void push_message( lua_State *L, vlm_message_t *message ) ...@@ -88,7 +88,7 @@ void push_message( lua_State *L, vlm_message_t *message )
int vlclua_vlm_execute_command( lua_State *L ) int vlclua_vlm_execute_command( lua_State *L )
{ {
vlm_t *p_vlm = (vlm_t*)vlclua_checkobject( L, 1, VLC_OBJECT_VLM ); vlm_t *p_vlm = (vlm_t*)vlclua_checkobject( L, 1, VLC_OBJECT_GENERIC );
const char *psz_command = luaL_checkstring( L, 2 ); const char *psz_command = luaL_checkstring( L, 2 );
vlm_message_t *message; vlm_message_t *message;
int i_ret; int i_ret;
......
...@@ -100,7 +100,7 @@ static vlm_media_sys_t *vlm_MediaSearch( vlm_t *, const char *); ...@@ -100,7 +100,7 @@ static vlm_media_sys_t *vlm_MediaSearch( vlm_t *, const char *);
vlm_t *__vlm_New ( vlc_object_t *p_this ) vlm_t *__vlm_New ( vlc_object_t *p_this )
{ {
vlc_value_t lockval; vlc_value_t lockval;
vlm_t *p_vlm = NULL; vlm_t *p_vlm = NULL, **pp_vlm = &(libvlc_priv (p_this->p_libvlc)->p_vlm);
char *psz_vlmconf; char *psz_vlmconf;
static const char vlm_object_name[] = "vlm daemon"; static const char vlm_object_name[] = "vlm daemon";
...@@ -111,9 +111,9 @@ vlm_t *__vlm_New ( vlc_object_t *p_this ) ...@@ -111,9 +111,9 @@ vlm_t *__vlm_New ( vlc_object_t *p_this )
vlc_mutex_lock( lockval.p_address ); vlc_mutex_lock( lockval.p_address );
p_vlm = vlc_object_find( p_this, VLC_OBJECT_VLM, FIND_ANYWHERE ); p_vlm = *pp_vlm;
if( p_vlm ) if( p_vlm )
{ { /* VLM already exists */
vlc_object_yield( p_vlm ); vlc_object_yield( p_vlm );
vlc_mutex_unlock( lockval.p_address ); vlc_mutex_unlock( lockval.p_address );
return p_vlm; return p_vlm;
...@@ -121,7 +121,7 @@ vlm_t *__vlm_New ( vlc_object_t *p_this ) ...@@ -121,7 +121,7 @@ vlm_t *__vlm_New ( vlc_object_t *p_this )
msg_Dbg( p_this, "creating VLM" ); msg_Dbg( p_this, "creating VLM" );
p_vlm = vlc_custom_create( p_this, sizeof( *p_vlm ), VLC_OBJECT_VLM, p_vlm = vlc_custom_create( p_this, sizeof( *p_vlm ), VLC_OBJECT_GENERIC,
vlm_object_name ); vlm_object_name );
if( !p_vlm ) if( !p_vlm )
{ {
...@@ -167,6 +167,7 @@ vlm_t *__vlm_New ( vlc_object_t *p_this ) ...@@ -167,6 +167,7 @@ vlm_t *__vlm_New ( vlc_object_t *p_this )
free(psz_vlmconf); free(psz_vlmconf);
vlc_object_set_destructor( p_vlm, (vlc_destructor_t)vlm_Destructor ); vlc_object_set_destructor( p_vlm, (vlc_destructor_t)vlm_Destructor );
*pp_vlm = p_vlm; /* for future reference */
vlc_mutex_unlock( lockval.p_address ); vlc_mutex_unlock( lockval.p_address );
return p_vlm; return p_vlm;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment