mirror of
https://github.com/Ryujinx/libsoundio.git
synced 2025-07-07 16:50:38 +00:00
ALSA: fix deadlock under some circumstances
If the write_callback came upon an error during the prepare phase, and never wrote any frames to the hardware buffer, and another thread tried to soundio_outstream_destroy, this would cause a deadlock. This is now fixed.
This commit is contained in:
parent
9c1a6d4930
commit
a3c4f85489
|
@ -1047,6 +1047,8 @@ static void outstream_thread_run(void *arg) {
|
||||||
|
|
||||||
if ((snd_pcm_uframes_t)avail == osa->buffer_size_frames) {
|
if ((snd_pcm_uframes_t)avail == osa->buffer_size_frames) {
|
||||||
outstream->write_callback(outstream, 0, avail);
|
outstream->write_callback(outstream, 0, avail);
|
||||||
|
if (!osa->thread_exit_flag.test_and_set())
|
||||||
|
return;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue