diff options
Diffstat (limited to 'src/DecoderControl.cxx')
-rw-r--r-- | src/DecoderControl.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/DecoderControl.cxx b/src/DecoderControl.cxx index d76580cbb..ab460ced0 100644 --- a/src/DecoderControl.cxx +++ b/src/DecoderControl.cxx @@ -30,6 +30,7 @@ DecoderControl::DecoderControl(Mutex &_mutex, Cond &_client_cond) :mutex(_mutex), client_cond(_client_cond), state(DecoderState::STOP), command(DecoderCommand::NONE), + client_is_waiting(false), song(nullptr), replay_gain_db(0), replay_gain_prev_db(0) {} @@ -41,6 +42,18 @@ DecoderControl::~DecoderControl() song->Free(); } +void +DecoderControl::WaitForDecoder() +{ + assert(!client_is_waiting); + client_is_waiting = true; + + client_cond.wait(mutex); + + assert(client_is_waiting); + client_is_waiting = false; +} + bool DecoderControl::IsCurrentSong(const Song &_song) const { |