]> git.sesse.net Git - vlc/blobdiff - src/libvlc.c
fix testapi test: libvlc_instance_(play|pause|stop) are asynchronous, so wait for...
[vlc] / src / libvlc.c
index 89f04d2133b1db36ee784646e2d2e0067c00473b..6d7ce25b6790b735202c3c41100d4bd504ccc172 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * libvlc.c: Implementation of the old libvlc API
  *****************************************************************************
- * Copyright (C) 1998-2006 the VideoLAN team
+ * Copyright (C) 1998-2007 the VideoLAN team
  * $Id$
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <vlc/vlc.h>
-#include <vlc/input.h>
 
-#include <libvlc_internal.h>
+#include "control/libvlc_internal.h"
+#include "libvlc.h"
 
-#include <vlc_error.h>
 #include <vlc_playlist.h>
 
-#include "audio_output.h"
-#include "vlc_video.h"
-#include "video_output.h"
+#include <vlc_aout.h>
+#include <vlc_vout.h>
 
 /*****************************************************************************
  * VLC_Version: return the libvlc version.
@@ -72,13 +74,11 @@ DECLARE_VLC_VERSION( CompileHost, COMPILE_HOST );
 DECLARE_VLC_VERSION( CompileDomain, COMPILE_DOMAIN );
 DECLARE_VLC_VERSION( Compiler, COMPILER );
 
-#ifndef HAVE_SHARED_LIBVLC
 extern const char psz_vlc_changeset[];
-char const * VLC_Changeset( void )
+const char* VLC_Changeset( void )
 {
     return psz_vlc_changeset;
 }
-#endif
 
 /*****************************************************************************
  * VLC_Error: strerror() equivalent
@@ -119,7 +119,7 @@ int VLC_Create( void )
  *  - message queue, module bank and playlist initialization
  *  - configuration and commandline parsing
  *****************************************************************************/
-int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
+int VLC_Init( int i_object, int i_argc, const char *ppsz_argv[] )
 {
     int i_ret;
     LIBVLC_FUNC;
@@ -152,13 +152,13 @@ int VLC_AddIntf( int i_object, char const *psz_module,
 /*****************************************************************************
  * VLC_Die: ask vlc to die.
  *****************************************************************************
- * This function sets p_vlc->b_die to VLC_TRUE, but does not do any other
+ * This function sets p_libvlc->b_die to VLC_TRUE, but does not do any other
  * task. It is your duty to call VLC_CleanUp and VLC_Destroy afterwards.
  *****************************************************************************/
 int VLC_Die( int i_object )
 {
     LIBVLC_FUNC;
-    p_libvlc->b_die = VLC_TRUE;
+    vlc_object_kill( p_libvlc );
     LIBVLC_FUNC_END;
     return VLC_SUCCESS;
 }
@@ -317,7 +317,7 @@ int VLC_AddTarget( int i_object, char const *psz_target,
     LIBVLC_PLAYLIST_FUNC;
     i_err = playlist_AddExt( p_libvlc->p_playlist, psz_target,
                              NULL,  i_mode, i_pos, -1,
-                             ppsz_options, i_options, VLC_TRUE );
+                             ppsz_options, i_options, VLC_TRUE, VLC_FALSE );
     LIBVLC_PLAYLIST_FUNC_END;
     return i_err;
 }
@@ -657,6 +657,7 @@ float VLC_SpeedSlower( int i_object )
  */
 int VLC_PlaylistIndex( int i_object )
 {
+    (void)i_object;
     printf( "This function is deprecated and should not be used anymore" );
     return -1;
 }
@@ -708,7 +709,7 @@ int VLC_PlaylistPrev( int i_object )
 int VLC_PlaylistClear( int i_object )
 {
     LIBVLC_PLAYLIST_FUNC;
-    playlist_Clear( p_libvlc->p_playlist );
+    playlist_Clear( p_libvlc->p_playlist, VLC_TRUE );
     LIBVLC_PLAYLIST_FUNC_END;
     return VLC_SUCCESS;
 }