]> git.sesse.net Git - vlc/blobdiff - src/libvlc.c
* ./src/misc/objects.c: two big changes in the object API: now objects can
[vlc] / src / libvlc.c
index 24cac14eaaad531434e7913d9672bbc73b97a794..20c0a11e66d1890bb55e41263faeee32ada263ba 100644 (file)
@@ -2,7 +2,7 @@
  * libvlc.c: main libvlc source
  *****************************************************************************
  * Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.c,v 1.20 2002/08/04 20:04:11 sam Exp $
+ * $Id: libvlc.c,v 1.25 2002/08/12 09:34:15 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -27,6 +27,7 @@
  * Pretend we are a builtin module
  *****************************************************************************/
 #define MODULE_NAME main
+#define MODULE_PATH main
 #define __BUILTIN__
 
 /*****************************************************************************
@@ -454,12 +455,16 @@ vlc_error_t vlc_init_r( vlc_t *p_vlc, int i_argc, char *ppsz_argv[] )
      */
     p_vlc->p_memcpy_module = module_Need( p_vlc, "memcpy", "$memcpy" );
 
-    if( p_vlc->p_memcpy_module == NULL )
+    if( p_vlc->pf_memcpy == NULL )
     {
-        msg_Warn( p_vlc, "no suitable memcpy module, using libc default" );
         p_vlc->pf_memcpy = memcpy;
     }
 
+    if( p_vlc->pf_memset == NULL )
+    {
+        p_vlc->pf_memset = memset;
+    }
+
     /*
      * Initialize shared resources and libraries
      */
@@ -584,7 +589,7 @@ vlc_error_t vlc_add_intf_r( vlc_t *p_vlc, const char *psz_module,
     err = intf_RunThread( p_intf );
     if( err )
     {
-        vlc_object_detach_all( p_intf );
+        vlc_object_detach( p_intf );
         intf_Destroy( p_intf );
         return err;
     }
@@ -608,7 +613,7 @@ vlc_error_t vlc_stop_r( vlc_t *p_vlc )
     intf_thread_t *p_intf;
     playlist_t    *p_playlist;
     vout_thread_t *p_vout;
-    aout_thread_t *p_aout;
+    aout_instance_t *p_aout;
 
     /* Check that the handle is valid */
     if( !p_vlc || p_vlc->i_status != VLC_STATUS_RUNNING )
@@ -624,7 +629,7 @@ vlc_error_t vlc_stop_r( vlc_t *p_vlc )
     while( (p_intf = vlc_object_find( p_vlc, VLC_OBJECT_INTF, FIND_CHILD )) )
     {
         intf_StopThread( p_intf );
-        vlc_object_detach_all( p_intf );
+        vlc_object_detach( p_intf );
         vlc_object_release( p_intf );
         intf_Destroy( p_intf );
     }
@@ -636,7 +641,7 @@ vlc_error_t vlc_stop_r( vlc_t *p_vlc )
     while( (p_playlist = vlc_object_find( p_vlc, VLC_OBJECT_PLAYLIST,
                                           FIND_CHILD )) )
     {
-        vlc_object_detach_all( p_playlist );
+        vlc_object_detach( p_playlist );
         vlc_object_release( p_playlist );
         playlist_Destroy( p_playlist );
     }
@@ -647,7 +652,7 @@ vlc_error_t vlc_stop_r( vlc_t *p_vlc )
     msg_Dbg( p_vlc, "removing all video outputs" );
     while( (p_vout = vlc_object_find( p_vlc, VLC_OBJECT_VOUT, FIND_CHILD )) )
     {
-        vlc_object_detach_all( p_vout );
+        vlc_object_detach( p_vout );
         vlc_object_release( p_vout );
         vout_DestroyThread( p_vout );
     }
@@ -658,9 +663,9 @@ vlc_error_t vlc_stop_r( vlc_t *p_vlc )
     msg_Dbg( p_vlc, "removing all audio outputs" );
     while( (p_aout = vlc_object_find( p_vlc, VLC_OBJECT_AOUT, FIND_CHILD )) )
     {
-        vlc_object_detach_all( p_aout );
-        vlc_object_release( p_aout );
-        aout_DestroyThread( p_aout );
+        vlc_object_detach( (vlc_object_t *)p_aout );
+        vlc_object_release( (vlc_object_t *)p_aout );
+        aout_DeleteInstance( p_aout );
     }
 
     /* Update the handle status */
@@ -765,7 +770,7 @@ vlc_error_t vlc_destroy_r( vlc_t *p_vlc )
     if( i_index == i_vlc )
     {
         fprintf( stderr, "error: trying to unregister %p which is not in "
-                         "the list\n", p_vlc );
+                         "the list\n", (void *)p_vlc );
         vlc_mutex_unlock( p_vlc->p_global_lock );
         vlc_object_destroy( p_vlc );
         return VLC_EGENERIC;