Commit 95e3bb2e authored by Pierre d'Herbemont's avatar Pierre d'Herbemont
Browse files

audio_output: Use a destructor.

parent aeaf0da4
......@@ -110,8 +110,8 @@ void aout_OutputDelete( aout_instance_t * p_aout );
/* From common.c : */
#define aout_New(a) __aout_New(VLC_OBJECT(a))
/* Release with vlc_object_release() */
aout_instance_t * __aout_New ( vlc_object_t * );
void aout_Delete ( aout_instance_t * );
void aout_FifoInit( aout_instance_t *, aout_fifo_t *, uint32_t );
mtime_t aout_FifoNextStart( aout_instance_t *, aout_fifo_t * );
......
......@@ -36,6 +36,9 @@
* Instances management (internal and external)
*/
/* Local functions */
static void aout_Destructor( vlc_object_t * p_this );
/*****************************************************************************
* aout_New: initialize aout structure
*****************************************************************************/
......@@ -65,16 +68,17 @@ aout_instance_t * __aout_New( vlc_object_t * p_parent )
val.b_bool = true;
var_Set( p_aout, "intf-change", val );
vlc_object_set_destructor( p_parent, aout_Destructor );
return p_aout;
}
/*****************************************************************************
* aout_Delete: destroy aout structure
* aout_Destructor: destroy aout structure
*****************************************************************************/
void aout_Delete( aout_instance_t * p_aout )
static void aout_Destructor( vlc_object_t * p_this )
{
var_Destroy( p_aout, "intf-change" );
aout_instance_t * p_aout = (aout_instance_t *)p_this;
vlc_mutex_destroy( &p_aout->input_fifos_lock );
vlc_mutex_destroy( &p_aout->mixer_lock );
vlc_mutex_destroy( &p_aout->output_fifo_lock );
......
......@@ -988,7 +988,7 @@ static void DeleteDecoder( decoder_t * p_dec )
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 );
vlc_object_release( p_dec->p_owner->p_aout );
p_dec->p_owner->p_aout = NULL;
}
if( p_dec->p_owner->p_vout )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment