Commit efb528f9 authored by Max Kellermann's avatar Max Kellermann

player/Thread: wake up the decoder when the pipe has run empty

This is another instance of the kludge we already have a few lines above that. It works around a deadlock/race condition revealed by commit 98a7c62d
parent edcd0b99
...@@ -1027,7 +1027,9 @@ Player::Run() noexcept ...@@ -1027,7 +1027,9 @@ Player::Run() noexcept
/* wake up the decoder (just in case it's /* wake up the decoder (just in case it's
waiting for space in the MusicBuffer) and waiting for space in the MusicBuffer) and
wait for it */ wait for it */
// TODO: eliminate this kludge
dc.Signal(); dc.Signal();
dc.WaitForDecoder(); dc.WaitForDecoder();
} else if (IsDecoderAtNextSong()) { } else if (IsDecoderAtNextSong()) {
/* at the beginning of a new song */ /* at the beginning of a new song */
...@@ -1049,6 +1051,12 @@ Player::Run() noexcept ...@@ -1049,6 +1051,12 @@ Player::Run() noexcept
new PCM data in time: wait for the new PCM data in time: wait for the
decoder */ decoder */
/* wake up the decoder (just in case it's
waiting for space in the MusicBuffer) and
wait for it */
// TODO: eliminate this kludge
dc.Signal();
dc.WaitForDecoder(); dc.WaitForDecoder();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment