mirror of
https://github.com/mpv-player/mpv
synced 2024-12-26 09:02:38 +00:00
audio: fix some issues when reloading the AO
We absolutely need to clear the AO reference in the mixer. The audio_status must be changed to a state where no code assumes that the AO is available. (It's allowed to do this blindly.)
This commit is contained in:
parent
4f63a812de
commit
f0efd0b100
@ -154,6 +154,7 @@ void uninit_audio_out(struct MPContext *mpctx)
|
||||
// Note: with gapless_audio, stop_play is not correctly set
|
||||
if (mpctx->opts->gapless_audio || mpctx->stop_play == AT_END_OF_FILE)
|
||||
ao_drain(mpctx->ao);
|
||||
mixer_uninit_audio(mpctx->mixer);
|
||||
ao_uninit(mpctx->ao);
|
||||
}
|
||||
mpctx->ao = NULL;
|
||||
@ -443,6 +444,8 @@ static void do_fill_audio_out_buffers(struct MPContext *mpctx, double endpts)
|
||||
if (mpctx->ao && ao_query_and_reset_events(mpctx->ao, AO_EVENT_RELOAD)) {
|
||||
ao_reset(mpctx->ao);
|
||||
uninit_audio_out(mpctx);
|
||||
if (d_audio)
|
||||
mpctx->audio_status = STATUS_SYNCING;
|
||||
}
|
||||
|
||||
if (!d_audio)
|
||||
|
Loading…
Reference in New Issue
Block a user