mirror of
https://github.com/mpv-player/mpv
synced 2025-03-20 10:17:31 +00:00
audio: fix deadlock on draining
The playback thread may obviously still fill the AO'S entire audio buffer, which means it unset p->draining, which makes no sense and broke ao_drain(). So just don't unset it here. Not sure if this really fixes this, it was hard to reproduce. Regression due to the recent changes. There are probably many more bugs like this. Stupid asynchronous nightmare state machine. Give me a language that supports formal verification (in presence of concurrency) or something.
This commit is contained in:
parent
5f49009849
commit
c67f36dd18
@ -632,7 +632,7 @@ static void ao_play_data(struct ao *ao)
|
||||
bool ok = true;
|
||||
int written = 0;
|
||||
if (samples) {
|
||||
p->draining = is_eof;
|
||||
p->draining |= is_eof;
|
||||
MP_STATS(ao, "start ao fill");
|
||||
ok = ao->driver->write(ao, planes, samples);
|
||||
MP_STATS(ao, "end ao fill");
|
||||
|
Loading…
Reference in New Issue
Block a user