]> git.sesse.net Git - vlc/blobdiff - src/control/core.c
- control APIs: do not crash if exception parameter is null, that means caller is...
[vlc] / src / control / core.c
index 1643fa6a9d21e7f15ed32c3c7fe5c5586f299005..3f7cc9aa19b3dc455c90f2972c6fa49bcb372527 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 #include <stdarg.h>
-#include <libvlc_internal.h>
+#include "libvlc_internal.h"
 #include <vlc/libvlc.h>
 
-#include <vlc/intf.h>
+#include <vlc_interface.h>
 
 /*************************************************************************
  * Exceptions handling
@@ -45,7 +45,7 @@ void libvlc_exception_clear( libvlc_exception_t *p_exception )
 
 inline int libvlc_exception_raised( libvlc_exception_t *p_exception )
 {
-    return p_exception->b_raised;
+    return (NULL != p_exception) && p_exception->b_raised;
 }
 
 inline char* libvlc_exception_get_message( libvlc_exception_t *p_exception )
@@ -58,7 +58,7 @@ inline char* libvlc_exception_get_message( libvlc_exception_t *p_exception )
 }
 
 inline void libvlc_exception_raise( libvlc_exception_t *p_exception,
-                                    char *psz_format, ... )
+                                    const char *psz_format, ... )
 {
     va_list args;
 
@@ -98,6 +98,8 @@ libvlc_instance_t * libvlc_new( int argc, char **argv,
 
     p_new->p_libvlc_int = p_libvlc_int;
     p_new->p_vlm = NULL;
+    p_new->b_playlist_locked = 0;
+    vlc_mutex_init(p_libvlc_int, &p_new->instance_lock);
 
     return p_new;
 }