aboutsummaryrefslogtreecommitdiffstats
path: root/src/PlayerThread.cxx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/PlayerThread.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/PlayerThread.cxx b/src/PlayerThread.cxx
index cb3d6a9a4..6fb41bf35 100644
--- a/src/PlayerThread.cxx
+++ b/src/PlayerThread.cxx
@@ -36,8 +36,6 @@
#include "util/Domain.hxx"
#include "Log.hxx"
-#include <glib.h>
-
#include <string.h>
static constexpr Domain player_domain("player");
@@ -1043,8 +1041,14 @@ Player::Run()
output thread is still busy, so it's
okay */
- /* XXX synchronize in a better way */
- g_usleep(10000);
+ pc.Lock();
+
+ /* wake up the decoder (just in case it's
+ waiting for space in the MusicBuffer) and
+ wait for it */
+ dc.Signal();
+ dc.WaitForDecoder();
+ continue;
} else if (IsDecoderAtNextSong()) {
/* at the beginning of a new song */