From 9a0645469f3513fd8008351f915bb3d3a7871f29 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Thu, 1 Nov 2012 19:09:52 +0200 Subject: [PATCH] aout: move aout_ChannelsRestart() --- src/audio_output/aout_internal.h | 1 - src/audio_output/dec.c | 18 +++++++++++++++++- src/audio_output/intf.c | 22 ---------------------- 3 files changed, 17 insertions(+), 24 deletions(-) diff --git a/src/audio_output/aout_internal.h b/src/audio_output/aout_internal.h index 9b24b231d4..b947348911 100644 --- a/src/audio_output/aout_internal.h +++ b/src/audio_output/aout_internal.h @@ -174,7 +174,6 @@ void aout_DecFlush(audio_output_t *); bool aout_DecIsEmpty(audio_output_t *); void aout_InputRequestRestart(audio_output_t *); -void aout_RequestRestart(audio_output_t *); /* Audio output locking */ static inline void aout_lock( audio_output_t *p_aout ) diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c index 92e4fdf9a0..52e4fcfd5a 100644 --- a/src/audio_output/dec.c +++ b/src/audio_output/dec.c @@ -166,7 +166,7 @@ static void aout_CheckRestart (audio_output_t *aout) * Marks the audio output for restart, to update any parameter of the output * plug-in (e.g. output device or channel mapping). */ -void aout_RequestRestart (audio_output_t *aout) +static void aout_RequestRestart (audio_output_t *aout) { aout_owner_t *owner = aout_owner (aout); @@ -174,6 +174,22 @@ void aout_RequestRestart (audio_output_t *aout) vlc_atomic_set (&owner->restart, AOUT_RESTART_OUTPUT|AOUT_RESTART_INPUT); } +int aout_ChannelsRestart (vlc_object_t *obj, const char *varname, + vlc_value_t oldval, vlc_value_t newval, void *data) +{ + audio_output_t *aout = (audio_output_t *)obj; + (void)oldval; (void)newval; (void)data; + + if (!strcmp (varname, "audio-device")) + { + /* This is supposed to be a significant change and supposes + * rebuilding the channel choices. */ + var_Destroy (aout, "stereo-mode"); + } + aout_RequestRestart (aout); + return 0; +} + /** * This function will safely mark aout input to be restarted as soon as * possible to take configuration changes into account diff --git a/src/audio_output/intf.c b/src/audio_output/intf.c index 63848c9ed5..94702fb233 100644 --- a/src/audio_output/intf.c +++ b/src/audio_output/intf.c @@ -131,26 +131,4 @@ int aout_MuteSet (vlc_object_t *obj, bool mute) } -/* - * Pipelines management - */ - -/***************************************************************************** - * aout_ChannelsRestart : change the audio device or channels and restart - *****************************************************************************/ -int aout_ChannelsRestart( vlc_object_t * p_this, const char * psz_variable, - vlc_value_t oldval, vlc_value_t newval, - void *p_data ) -{ - audio_output_t * p_aout = (audio_output_t *)p_this; - (void)oldval; (void)newval; (void)p_data; - if ( !strcmp( psz_variable, "audio-device" ) ) - { - /* This is supposed to be a significant change and supposes - * rebuilding the channel choices. */ - var_Destroy( p_aout, "stereo-mode" ); - } - aout_RequestRestart (p_aout); - return 0; -} -- 2.39.2