]> git.sesse.net Git - vlc/blobdiff - src/control/core.c
Play and add (Refs:#457)
[vlc] / src / control / core.c
index d38bf4ee1b4dded5aee594e68926e2bf8725fe0d..5e5f828ecbe25645f446fc6408376efb7260170e 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (C) 2005 the VideoLAN team
  * $Id$
  *
- * Authors: Clément Stenac <zorglub@videolan.org>
+ * Authors: Clent Stenac <zorglub@videolan.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -26,8 +26,6 @@
 
 #include <vlc/intf.h>
 
-vlc_t * vlc_current_object( int );
-
 /*************************************************************************
  * Exceptions handling
  *************************************************************************/
@@ -37,6 +35,13 @@ inline void libvlc_exception_init( libvlc_exception_t *p_exception )
     p_exception->psz_message = NULL;
 }
 
+void libvlc_exception_clear( libvlc_exception_t *p_exception )
+{
+    if( p_exception->psz_message )
+        free( p_exception->psz_message );
+    p_exception->b_raised = 0;
+}
+
 inline int libvlc_exception_raised( libvlc_exception_t *p_exception )
 {
     return p_exception->b_raised;
@@ -56,10 +61,10 @@ inline void libvlc_exception_raise( libvlc_exception_t *p_exception,
 {
     if( p_exception == NULL ) return;
     p_exception->b_raised = 1;
-    p_exception->psz_message = strdup( psz_message );
+    if( psz_message )
+        p_exception->psz_message = strdup( psz_message );
 }
 
-
 libvlc_instance_t * libvlc_new( int argc, char **argv,
                                 libvlc_exception_t *p_exception )
 {