From 075edc6feea0273bacf4ea26e8866c32d83e3ad8 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 22 Sep 2016 20:56:34 +0200 Subject: player: make audio-channels etc. runtime settable If one of the audio output format options is set, brually reinit the audio chain. Since the audio-channels property is still mapped to the deprecated read-only property, "options/audio-channels" currently has to be used, e.g. "cycle-values options/audio-channels 2 7.1". --- player/command.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'player/command.c') diff --git a/player/command.c b/player/command.c index d49b844caf..5983059448 100644 --- a/player/command.c +++ b/player/command.c @@ -5624,6 +5624,13 @@ void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags) mpctx->ipc_ctx = mp_init_ipc(mpctx->clients, mpctx->global); } } + + if ((flags & UPDATE_AUDIO) && mpctx->ao_chain) { + // Force full mid-stream reinit. + reinit_audio_filters(mpctx); + uninit_audio_out(mpctx); + mp_wakeup_core(mpctx); + } } void mp_notify_property(struct MPContext *mpctx, const char *property) -- cgit v1.2.3