]> git.sesse.net Git - vlc/blobdiff - src/control/vlm.c
libvlc: Properly release vout. Pointed out by Lukas.
[vlc] / src / control / vlm.c
index 78df6c3d1c91b5e7509fd43aa53ab8f6b7288120..f75613da3f3c06edb3d9de9b0c6d0b1a3b262532 100644 (file)
@@ -91,10 +91,12 @@ char* libvlc_vlm_show_media( libvlc_instance_t *p_instance, char *psz_name,
     }
     free( psz_message );
     return(psz_response );
-#endif
+#else
+    libvlc_exception_raise( p_exception, "VLM has been disabled in this libvlc." );
     return NULL;
-}
 #endif
+}
+#endif /* 0 */
 
 static int libvlc_vlm_init( libvlc_instance_t *p_instance,
                             libvlc_exception_t *p_exception )
@@ -102,12 +104,15 @@ static int libvlc_vlm_init( libvlc_instance_t *p_instance,
 #ifdef ENABLE_VLM
     if( !p_instance->p_vlm )
         p_instance->p_vlm = vlm_New( p_instance->p_libvlc_int );
+#else
+    libvlc_exception_raise( p_exception, "VLM has been disabled in this libvlc." );
+    return VLC_EGENERIC;
 #endif
 
     if( !p_instance->p_vlm )
     {
         libvlc_exception_raise( p_exception,
-                                "Unable to create VLM. It might be disabled." );
+                                "Unable to create VLM." );
         return VLC_EGENERIC;
     }
     return VLC_SUCCESS;
@@ -174,7 +179,7 @@ void libvlc_vlm_add_broadcast( libvlc_instance_t *p_instance, char *psz_name,
     vlm_media_Init( &m );
     m.psz_name = strdup( psz_name );
     m.b_enabled = b_enabled;
-    m.b_vod = VLC_FALSE;
+    m.b_vod = false;
     m.broadcast.b_loop = b_loop;
     if( psz_input )
         TAB_APPEND( m.i_input, m.ppsz_input, strdup(psz_input) );
@@ -357,7 +362,7 @@ void libvlc_vlm_seek_media( libvlc_instance_t *p_instance, char *psz_name,
 }
 
 #define LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( attr, returnType, getType, ret, code )\
-returnType libvlc_vlm_get_media_## attr( libvlc_instance_t *p_instance, \
+returnType libvlc_vlm_get_media_instance_## attr( libvlc_instance_t *p_instance, \
                         char *psz_name, int i_instance, libvlc_exception_t *p_exception ) \
 { \
     vlm_media_instance_t *p_mi = libvlc_vlm_get_media_instance( p_instance, psz_name, i_instance, \
@@ -379,13 +384,14 @@ LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( rate,     int, Integer, -1, ret_value = p_mi->i_
 /* FIXME extend vlm_media_instance_t to be able to implement them */
 LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( title,    int, Integer,  0, ret_value = 0 );
 LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( chapter,  int, Integer,  0, ret_value = 0 );
-LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( seekable, int, Bool,     0, ret_value = VLC_FALSE );
+LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( seekable, int, Bool,     0, ret_value = false );
 
 #undef LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
 
 char* libvlc_vlm_show_media( libvlc_instance_t *p_instance, char *psz_name,
                              libvlc_exception_t *p_exception )
 {
+    (void)p_instance;
     /* FIXME is it needed ? */
     libvlc_exception_raise( p_exception, "Unable to call show %s", psz_name );
     return NULL;