]> git.sesse.net Git - vlc/commitdiff
Remove audio output recycling support. It kept crashing.
authorRémi Denis-Courmont <rem@videolan.org>
Sun, 25 May 2008 10:19:03 +0000 (13:19 +0300)
committerRémi Denis-Courmont <rem@videolan.org>
Sun, 25 May 2008 10:19:03 +0000 (13:19 +0300)
src/audio_output/dec.c
src/input/decoder.c
src/libvlc-common.c

index fa99ea1a7fe79d55cb66acf3cb328c0bcd3951ab..2c53d83632bf16a0fb5f9ae7705c895b3fa79e39 100644 (file)
@@ -173,30 +173,21 @@ aout_input_t * __aout_DecNew( vlc_object_t * p_this,
                               audio_sample_format_t * p_format,
                               audio_replay_gain_t *p_replay_gain )
 {
-    if ( *pp_aout == NULL )
+    aout_instance_t *p_aout = *pp_aout;
+    if ( p_aout == NULL )
     {
-        /* Create an audio output if there is none. */
-        *pp_aout = vlc_object_find( p_this, VLC_OBJECT_AOUT, FIND_ANYWHERE );
+        msg_Dbg( p_this, "no aout present, spawning one" );
+        p_aout = aout_New( p_this );
 
-        if( *pp_aout == NULL )
-        {
-            msg_Dbg( p_this, "no aout present, spawning one" );
+        /* Everything failed, I'm a loser, I just wanna die */
+        if( p_aout == NULL )
+            return NULL;
 
-            *pp_aout = aout_New( p_this );
-            /* Everything failed, I'm a loser, I just wanna die */
-            if( *pp_aout == NULL )
-            {
-                return NULL;
-            }
-            vlc_object_attach( *pp_aout, p_this->p_libvlc );
-        }
-        else
-        {
-            vlc_object_release( *pp_aout );
-        }
+        vlc_object_attach( p_aout, p_this );
+        *pp_aout = p_aout;
     }
 
-    return DecNew( p_this, *pp_aout, p_format, p_replay_gain );
+    return DecNew( p_this, p_aout, p_format, p_replay_gain );
 }
 
 /*****************************************************************************
index 78908b577c8b06dd31f5e26100621ce855c6b670..d7768c2dd4b516e2e5d501fd9e47ae82665d6e48 100644 (file)
@@ -986,7 +986,11 @@ static void DeleteDecoder( decoder_t * p_dec )
     /* Cleanup */
     if( p_dec->p_owner->p_aout_input )
         aout_DecDelete( p_dec->p_owner->p_aout, p_dec->p_owner->p_aout_input );
-
+    if( p_dec->p_owner->p_aout )
+    {
+        aout_Delete( p_dec->p_owner->p_aout );
+        p_dec->p_owner->p_aout = NULL;
+    }
     if( p_dec->p_owner->p_vout )
     {
         int i_pic;
index f5891ddcc22cdf1eef6b3fd6acf5d152fcfea46b..c5446bfe914a3a89c4c12f593d917cf80443b03d 100644 (file)
@@ -945,15 +945,6 @@ int libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
         vout_Destroy( p_vout );
     }
 
-    /* Free audio outputs */
-    msg_Dbg( p_libvlc, "removing all audio outputs" );
-    while( (p_aout = vlc_object_find( p_libvlc, VLC_OBJECT_AOUT, FIND_CHILD )) )
-    {
-        vlc_object_detach( (vlc_object_t *)p_aout );
-        vlc_object_release( (vlc_object_t *)p_aout );
-        aout_Delete( p_aout );
-    }
-
 #ifdef ENABLE_SOUT
     playlist_t         * p_playlist;
     sout_instance_t    * p_sout;