diff --git a/include/aout_internal.h b/include/aout_internal.h index 7d6490c8e5..2978bd1a91 100644 --- a/include/aout_internal.h +++ b/include/aout_internal.h @@ -2,7 +2,7 @@ * aout_internal.h : internal defines for audio output ***************************************************************************** * Copyright (C) 2002 VideoLAN - * $Id: aout_internal.h,v 1.36 2002/12/07 23:50:30 massiot Exp $ + * $Id: aout_internal.h,v 1.37 2003/01/23 17:13:28 massiot Exp $ * * Authors: Christophe Massiot * @@ -128,7 +128,7 @@ typedef struct aout_mixer_t void (* pf_do_work)( struct aout_instance_t *, struct aout_buffer_t * ); - /* If b_error == 1, there is no mixer nor audio output pipeline. */ + /* If b_error == 1, there is no mixer. */ vlc_bool_t b_error; /* Multiplier used to raise or lower the volume of the sound in * software. Beware, this creates sound distortion and should be avoided @@ -202,6 +202,9 @@ typedef struct aout_output_t audio_volume_t i_volume; /* Saved volume for aout_VolumeMute(). */ audio_volume_t i_saved_volume; + + /* If b_error == 1, there is no audio output pipeline. */ + vlc_bool_t b_error; } aout_output_t; /***************************************************************************** @@ -264,7 +267,7 @@ void aout_FiltersPlay( aout_instance_t * p_aout, /* From mixer.c : */ int aout_MixerNew( aout_instance_t * p_aout ); -int aout_MixerDelete( aout_instance_t * p_aout ); +void aout_MixerDelete( aout_instance_t * p_aout ); void aout_MixerRun( aout_instance_t * p_aout ); int aout_MixerMultiplierSet( aout_instance_t * p_aout, float f_multiplier ); int aout_MixerMultiplierGet( aout_instance_t * p_aout, float * pf_multiplier ); diff --git a/src/audio_output/common.c b/src/audio_output/common.c index c63e3055c4..e02813bb8c 100644 --- a/src/audio_output/common.c +++ b/src/audio_output/common.c @@ -2,7 +2,7 @@ * common.c : audio output management of common data structures ***************************************************************************** * Copyright (C) 2002 VideoLAN - * $Id: common.c,v 1.15 2003/01/22 18:31:47 massiot Exp $ + * $Id: common.c,v 1.16 2003/01/23 17:13:28 massiot Exp $ * * Authors: Christophe Massiot * @@ -59,6 +59,7 @@ aout_instance_t * __aout_New( vlc_object_t * p_parent ) p_aout->i_nb_inputs = 0; p_aout->mixer.f_multiplier = 1.0; p_aout->mixer.b_error = 1; + p_aout->output.b_error = 1; p_aout->output.b_starving = 1; var_Create( p_aout, "intf-change", VLC_VAR_BOOL ); diff --git a/src/audio_output/mixer.c b/src/audio_output/mixer.c index f64a066814..5c66c45190 100644 --- a/src/audio_output/mixer.c +++ b/src/audio_output/mixer.c @@ -2,7 +2,7 @@ * mixer.c : audio output mixing operations ***************************************************************************** * Copyright (C) 2002 VideoLAN - * $Id: mixer.c,v 1.23 2003/01/06 22:07:47 massiot Exp $ + * $Id: mixer.c,v 1.24 2003/01/23 17:13:28 massiot Exp $ * * Authors: Christophe Massiot * @@ -58,13 +58,11 @@ int aout_MixerNew( aout_instance_t * p_aout ) ***************************************************************************** * Please note that you must hold the mixer lock. *****************************************************************************/ -int aout_MixerDelete( aout_instance_t * p_aout ) +void aout_MixerDelete( aout_instance_t * p_aout ) { - if ( p_aout->mixer.b_error ) return 0; + if ( p_aout->mixer.b_error ) return; module_Unneed( p_aout, p_aout->mixer.p_module ); p_aout->mixer.b_error = 1; - - return 0; } /***************************************************************************** diff --git a/src/audio_output/output.c b/src/audio_output/output.c index f409f4000f..b2141f91da 100644 --- a/src/audio_output/output.c +++ b/src/audio_output/output.c @@ -2,7 +2,7 @@ * output.c : internal management of output streams for the audio output ***************************************************************************** * Copyright (C) 2002 VideoLAN - * $Id: output.c,v 1.32 2003/01/23 11:48:18 massiot Exp $ + * $Id: output.c,v 1.33 2003/01/23 17:13:28 massiot Exp $ * * Authors: Christophe Massiot * @@ -200,6 +200,7 @@ int aout_OutputNew( aout_instance_t * p_aout, p_aout->output.i_nb_filters, &p_aout->mixer.output_alloc ); + p_aout->output.b_error = 0; return 0; } @@ -210,11 +211,14 @@ int aout_OutputNew( aout_instance_t * p_aout, *****************************************************************************/ void aout_OutputDelete( aout_instance_t * p_aout ) { + if ( p_aout->output.b_error ) return 0; module_Unneed( p_aout, p_aout->output.p_module ); aout_FiltersDestroyPipeline( p_aout, p_aout->output.pp_filters, p_aout->output.i_nb_filters ); aout_FifoDestroy( p_aout, &p_aout->output.fifo ); + + p_aout->output.b_error = 1; } /*****************************************************************************