]> git.sesse.net Git - vlc/blobdiff - src/control/vlm.c
libvlc_vlm_release added
[vlc] / src / control / vlm.c
index 6072eec2c725f23340d38b3685b179139c9ba21a..7ea608667be4f0ffcdec0a747b1b3d648a72ad96 100644 (file)
@@ -2,7 +2,7 @@
  * vlm.c: libvlc new API VLM handling functions
  *****************************************************************************
  * Copyright (C) 2005 the VideoLAN team
- * $Id: playlist.c 14265 2006-02-12 17:31:39Z zorglub $
+ * $Id$
  *
  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
  *
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#include "libvlc_internal.h"
+
 #include <vlc/libvlc.h>
 #include <vlc_es.h>
 #include <vlc_input.h>
 #include <vlc_vlm.h>
 
-#include "libvlc_internal.h"
-
 #if 0
 /* local function to be used in libvlc_vlm_show_media only */
 static char* recurse_answer( char* psz_prefix, vlm_message_t *p_answer ) {
@@ -118,6 +118,16 @@ static int libvlc_vlm_init( libvlc_instance_t *p_instance,
   } while(0)
 #define VLM(p) VLM_RET(p,)
 
+void libvlc_vlm_release( libvlc_instance_t *p_instance, libvlc_exception_t *p_exception)
+{
+    vlm_t *p_vlm;
+
+    VLM(p_vlm);
+
+    vlm_Delete( p_vlm );
+}
+
+
 void libvlc_vlm_add_broadcast( libvlc_instance_t *p_instance, char *psz_name,
                                char *psz_input, char *psz_output,
                                int i_options, char **ppsz_options,
@@ -208,7 +218,7 @@ void libvlc_vlm_set_loop( libvlc_instance_t *p_instance, char *psz_name,
 void libvlc_vlm_set_output( libvlc_instance_t *p_instance, char *psz_name,
                             char *psz_output,  libvlc_exception_t *p_exception )
 {
-#define VLM_CHANGE_CODE { if( p_media->psz_output ) free( p_media->psz_output ); \
+#define VLM_CHANGE_CODE { free( p_media->psz_output ); \
                           p_media->psz_output = strdup( psz_output ); }
     VLM_CHANGE( "Unable to change %s output property", VLM_CHANGE_CODE );
 #undef VLM_CHANGE_CODE
@@ -232,7 +242,6 @@ void libvlc_vlm_add_input( libvlc_instance_t *p_instance, char *psz_name,
 #undef VLM_CHANGE_CODE
 }
 
-
 void libvlc_vlm_change_media( libvlc_instance_t *p_instance, char *psz_name,
                               char *psz_input, char *psz_output, int i_options,
                               char **ppsz_options, int b_enabled, int b_loop,
@@ -245,8 +254,7 @@ void libvlc_vlm_change_media( libvlc_instance_t *p_instance, char *psz_name,
         free( p_media->ppsz_input[--p_media->i_input] );    \
     if( psz_input )                     \
         TAB_APPEND( p_media->i_input, p_media->ppsz_input, strdup(psz_input) ); \
-    if( p_media->psz_output )           \
-        free( p_media->psz_output );    \
+    free( p_media->psz_output );        \
     p_media->psz_output = psz_output ? strdup( psz_output ) : NULL; \
     while( p_media->i_option > 0 )     \
         free( p_media->ppsz_option[--p_media->i_option] );        \
@@ -259,7 +267,6 @@ void libvlc_vlm_change_media( libvlc_instance_t *p_instance, char *psz_name,
 
 void libvlc_vlm_play_media( libvlc_instance_t *p_instance, char *psz_name,
                             libvlc_exception_t *p_exception )
-    
 {
     vlm_t *p_vlm;
     int64_t id;
@@ -275,7 +282,6 @@ void libvlc_vlm_play_media( libvlc_instance_t *p_instance, char *psz_name,
 
 void libvlc_vlm_stop_media( libvlc_instance_t *p_instance, char *psz_name,
                             libvlc_exception_t *p_exception )
-    
 {
     vlm_t *p_vlm;
     int64_t id;
@@ -291,7 +297,6 @@ void libvlc_vlm_stop_media( libvlc_instance_t *p_instance, char *psz_name,
 
 void libvlc_vlm_pause_media( libvlc_instance_t *p_instance, char *psz_name,
                             libvlc_exception_t *p_exception )
-    
 {
     vlm_t *p_vlm;
     int64_t id;
@@ -307,7 +312,6 @@ void libvlc_vlm_pause_media( libvlc_instance_t *p_instance, char *psz_name,
 
 void libvlc_vlm_seek_media( libvlc_instance_t *p_instance, char *psz_name,
                             float f_percentage, libvlc_exception_t *p_exception )
-    
 {
     vlm_t *p_vlm;
     int64_t id;
@@ -385,4 +389,3 @@ char* libvlc_vlm_show_media( libvlc_instance_t *p_instance, char *psz_name,
     libvlc_exception_raise( p_exception, "Unable to call show %s", psz_name );
     return NULL;
 }
-