From: RĂ©mi Denis-Courmont Date: Sun, 25 May 2008 10:19:03 +0000 (+0300) Subject: Remove audio output recycling support. It kept crashing. X-Git-Tag: 0.9.0-test0~748 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=a398f405e6926b5c7be66e6fce3c7b600e5806e1;p=vlc Remove audio output recycling support. It kept crashing. --- diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c index fa99ea1a7f..2c53d83632 100644 --- a/src/audio_output/dec.c +++ b/src/audio_output/dec.c @@ -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 ); } /***************************************************************************** diff --git a/src/input/decoder.c b/src/input/decoder.c index 78908b577c..d7768c2dd4 100644 --- a/src/input/decoder.c +++ b/src/input/decoder.c @@ -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; diff --git a/src/libvlc-common.c b/src/libvlc-common.c index f5891ddcc2..c5446bfe91 100644 --- a/src/libvlc-common.c +++ b/src/libvlc-common.c @@ -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;