[vlc-devel] commit: Remove audio output recycling support. It kept crashing. ( Rémi Denis-Courmont )
git version control
git at videolan.org
Sun May 25 12:17:31 CEST 2008
vlc | branch: master | Rémi Denis-Courmont <rem at videolan.org> | Sun May 25 13:19:03 2008 +0300| [a398f405e6926b5c7be66e6fce3c7b600e5806e1]
Remove audio output recycling support. It kept crashing.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a398f405e6926b5c7be66e6fce3c7b600e5806e1
---
src/audio_output/dec.c | 29 ++++++++++-------------------
src/input/decoder.c | 6 +++++-
src/libvlc-common.c | 9 ---------
3 files changed, 15 insertions(+), 29 deletions(-)
diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c
index fa99ea1..2c53d83 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 78908b5..d7768c2 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 f5891dd..c5446bf 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;
More information about the vlc-devel
mailing list