audio: fix missing volume update on init and reinit

This is never updated after the AO inits, so there are several cases
where the volume would stay at 100%, even if it shouldn't. This affects
initial volume as well as track switching or switching between files.
This commit is contained in:
wm4 2017-12-01 21:16:59 +01:00
parent 2e24f5f1b5
commit 076b1d266e
1 changed files with 3 additions and 0 deletions

View File

@ -538,6 +538,7 @@ static void reinit_audio_filters_and_output(struct MPContext *mpctx)
#endif #endif
update_playback_speed(mpctx); update_playback_speed(mpctx);
audio_update_volume(mpctx);
mp_notify(mpctx, MPV_EVENT_AUDIO_RECONFIG, NULL); mp_notify(mpctx, MPV_EVENT_AUDIO_RECONFIG, NULL);
@ -629,6 +630,8 @@ void reinit_audio_chain_src(struct MPContext *mpctx, struct track *track)
struct mp_chmap channels; struct mp_chmap channels;
ao_get_format(mpctx->ao, &rate, &format, &channels); ao_get_format(mpctx->ao, &rate, &format, &channels);
mp_audio_buffer_reinit_fmt(ao_c->ao_buffer, format, &channels, rate); mp_audio_buffer_reinit_fmt(ao_c->ao_buffer, format, &channels, rate);
audio_update_volume(mpctx);
} }
mp_wakeup_core(mpctx); mp_wakeup_core(mpctx);