mirror of https://github.com/mpv-player/mpv
command: flush and uninitialize audio output first on option changes
This affects changing audio configuration options. Explicitly flush and uninitialize the audio output first before doing the rest. This should ensure all state attached to the audio output is discarded and not used during the reconfiguration. Also add a comment to the reinit_audio_filters() call. It doesn't necessarily restore the audio chain fully, but makes sure a seek is issued if the amnount of buffered audio discarded was huge enough to cause "problems".
This commit is contained in:
parent
e6291697e3
commit
3825dc63b2
|
@ -5737,8 +5737,10 @@ 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.
|
||||
reinit_audio_filters(mpctx);
|
||||
if (mpctx->ao)
|
||||
ao_reset(mpctx->ao);
|
||||
uninit_audio_out(mpctx);
|
||||
reinit_audio_filters(mpctx); // mostly to issue refresh seek
|
||||
mp_wakeup_core(mpctx);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue