diff options
author | wm4 <wm4@nowhere> | 2016-10-05 16:42:43 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-10-05 16:42:43 +0200 |
commit | 6fb12a5fdaf95bf5ded286c8db18a30e392964e1 (patch) | |
tree | f37b67eacbe3375f01dba627800dee93ff220351 /player/command.c | |
parent | 3825dc63b2d29f3dc7dbd8f9e5e8db4293d3421b (diff) | |
download | mpv-6fb12a5fdaf95bf5ded286c8db18a30e392964e1.tar.bz2 mpv-6fb12a5fdaf95bf5ded286c8db18a30e392964e1.tar.xz |
audio: move some fallback handling to common AO reload function
Now a reload requested by an AO behaves in exactly the same way as
changing an AO-related options (like --audio-channels or
--audio-exclusive). This is good for testing and uniform behavior. (You
could go as far as saying it's a necessity, because the spotty and
obscure AO reload behavior is hard to reproduce and thus hard to test at
all.)
Diffstat (limited to 'player/command.c')
-rw-r--r-- | player/command.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/player/command.c b/player/command.c index e11f485056..96f60d70a9 100644 --- a/player/command.c +++ b/player/command.c @@ -1881,13 +1881,6 @@ static int get_device_entry(int item, int action, void *arg, void *ctx) return m_property_read_sub(props, action, arg); } -static void reload_audio_output(struct MPContext *mpctx) -{ - if (!mpctx->ao) - return; - ao_request_reload(mpctx->ao); -} - static void create_hotplug(struct MPContext *mpctx) { struct command_ctx *cmd = mpctx->command_ctx; @@ -5735,14 +5728,8 @@ void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags) } } - if ((flags & UPDATE_AUDIO) && mpctx->ao_chain) { - // Force full mid-stream reinit. - if (mpctx->ao) - ao_reset(mpctx->ao); - uninit_audio_out(mpctx); - reinit_audio_filters(mpctx); // mostly to issue refresh seek - mp_wakeup_core(mpctx); - } + if (flags & UPDATE_AUDIO) + reload_audio_output(mpctx); if (flags & UPDATE_PRIORITY) update_priority(mpctx); |