]> git.sesse.net Git - vlc/blobdiff - src/libvlc-common.c
Remove a bunch of obsoleted kludges
[vlc] / src / libvlc-common.c
index 85b94e9f6e811fb858aa6cf5418cd10f31e5939e..ee4dfe7fce222f062cc36e5daf6734a696041e4a 100644 (file)
@@ -187,7 +187,7 @@ libvlc_int_t * libvlc_InternalCreate( void )
     p_libvlc->p_playlist = NULL;
     p_libvlc->p_interaction = NULL;
     p_libvlc->p_vlm = NULL;
-    p_libvlc->psz_object_name = "libvlc";
+    p_libvlc->psz_object_name = strdup( "libvlc" );
 
     /* Initialize message queue */
     msg_Create( p_libvlc );
@@ -254,16 +254,18 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
     /* Get the executable name (similar to the basename command) */
     if( i_argc > 0 )
     {
-        const char *exe = p_libvlc->psz_object_name = ppsz_argv[0];
+        const char *exe = strdup( ppsz_argv[0] );
+        const char *tmp = exe;
         while( *exe )
         {
             if( *exe++ == '/' )
-                p_libvlc->psz_object_name = exe;
+                tmp = exe;
         }
+        p_libvlc->psz_object_name = strdup( tmp );
     }
     else
     {
-        p_libvlc->psz_object_name = "vlc";
+        p_libvlc->psz_object_name = strdup( "vlc" );
     }
 
     /*
@@ -943,6 +945,7 @@ int libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
     vout_thread_t      * p_vout = NULL;
     aout_instance_t    * p_aout = NULL;
     announce_handler_t * p_announce = NULL;
+    sout_instance_t    * p_sout = NULL;
 
     /* Ask the interfaces to stop and destroy them */
     msg_Dbg( p_libvlc, "removing all interfaces" );
@@ -977,6 +980,15 @@ int libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
         aout_Delete( p_aout );
     }
 
+    p_sout = vlc_object_find( p_libvlc, VLC_OBJECT_SOUT, FIND_CHILD );
+    if( p_sout )
+    {
+        msg_Dbg( p_sout, "removing kept stream output" );
+        vlc_object_detach( (vlc_object_t*)p_sout );
+        vlc_object_release( (vlc_object_t*)p_sout );
+        sout_DeleteInstance( p_sout );
+    }
+
     /* Destroy VLM if created in libvlc_InternalInit */
     if( p_libvlc->p_vlm )
     {
@@ -2056,6 +2068,7 @@ static void InitDeviceValues( libvlc_int_t *p_vlc )
 #ifdef HAVE_HAL_1
         libhal_ctx_shutdown( ctx, NULL );
         dbus_connection_unref( p_connection );
+        libhal_ctx_free( ctx );
 #else
         hal_shutdown( ctx );
 #endif