[vlc-devel] commit: Instantiate VLM if vlm-conf option is used. You can now use VLM without having to launch the telnet or http interface. (Antoine Cellerier )

git version control git at videolan.org
Sun Mar 30 23:56:12 CEST 2008


vlc | branch: master | Antoine Cellerier <dionoea at videolan.org> | Sun Mar 30 22:47:47 2008 +0200| [f39e70a249501414008f59c508499c0d88ea7325]

Instantiate VLM if vlm-conf option is used. You can now use VLM without having to launch the telnet or http interface.

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

 src/libvlc-common.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/src/libvlc-common.c b/src/libvlc-common.c
index d2c06d5..a0ba3cd 100644
--- a/src/libvlc-common.c
+++ b/src/libvlc-common.c
@@ -93,6 +93,8 @@
 
 #include "playlist/playlist_internal.h"
 
+#include <vlc_vlm.h>
+
 /*****************************************************************************
  * The evil global variable. We handle it with care, don't worry.
  *****************************************************************************/
@@ -766,6 +768,15 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
     }
     free( psz_modules );
 
+    /* Initialize VLM if vlm-conf is specified */
+    psz_parser = config_GetPsz( p_libvlc, "vlm-conf" );
+    if( psz_parser && *psz_parser )
+    {
+        if( !vlm_New( p_libvlc ) )
+            msg_Err( p_libvlc, "VLM initialization failed" );
+    }
+    free( psz_parser );
+
     /*
      * Load background interfaces
      */
@@ -923,6 +934,7 @@ int libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
     vout_thread_t      * p_vout = NULL;
     aout_instance_t    * p_aout = NULL;
     announce_handler_t * p_announce = NULL;
+    vlm_t              * p_vlm = NULL;
 
     /* Ask the interfaces to stop and destroy them */
     msg_Dbg( p_libvlc, "removing all interfaces" );
@@ -986,6 +998,11 @@ int libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
     vlc_mutex_destroy( &p_libvlc->p_stats->lock );
     FREENULL( p_libvlc->p_stats );
 
+    /* Destroy VLM if created in libvlc_InternalInit */
+    p_vlm = vlc_object_find( p_libvlc, VLC_OBJECT_VLM, FIND_ANYWHERE );
+    if( p_vlm )
+        vlm_Delete( p_vlm );
+
     return VLC_SUCCESS;
 }
 




More information about the vlc-devel mailing list