diff options
author | wm4 <wm4@nowhere> | 2016-09-22 20:56:34 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-09-22 20:57:06 +0200 |
commit | 075edc6feea0273bacf4ea26e8866c32d83e3ad8 (patch) | |
tree | 32cf49a6fc8d94a0e93425cdf0c2b61d24d87594 /player/command.c | |
parent | 2ac74977c5f6561e33ad37c68b9da47739c7fd6c (diff) | |
download | mpv-075edc6feea0273bacf4ea26e8866c32d83e3ad8.tar.bz2 mpv-075edc6feea0273bacf4ea26e8866c32d83e3ad8.tar.xz |
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".
Diffstat (limited to 'player/command.c')
-rw-r--r-- | player/command.c | 7 |
1 files changed, 7 insertions, 0 deletions
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) |