diff options
author | Max Kellermann <max@musicpd.org> | 2018-11-06 23:52:26 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-11-06 23:52:26 +0100 |
commit | 451b142e3a0a953f2198c8549481032f1acbff12 (patch) | |
tree | 57298adad6e6080abee00bcfa55a3a8b1ff5c3c4 /src | |
parent | 283362526655c8aded0b5ba1f5f1f58c7213cf4e (diff) |
player/Thread: finish decoder startup before checking the buffer
This fixes a valgrind warning because `buffer_before_play`
initialization needs to know the audio format from the decoder.
Diffstat (limited to 'src')
-rw-r--r-- | src/player/Thread.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/player/Thread.cxx b/src/player/Thread.cxx index 656aa80e4..b6b107c3b 100644 --- a/src/player/Thread.cxx +++ b/src/player/Thread.cxx @@ -970,6 +970,15 @@ Player::Run() noexcept pc.CommandFinished(); while (ProcessCommand()) { + if (decoder_starting) { + /* wait until the decoder is initialized completely */ + + if (!CheckDecoderStartup()) + break; + + continue; + } + if (buffering) { /* buffering at the start of the song - wait until the buffer is large enough, to @@ -987,15 +996,6 @@ Player::Run() noexcept } } - if (decoder_starting) { - /* wait until the decoder is initialized completely */ - - if (!CheckDecoderStartup()) - break; - - continue; - } - if (dc.IsIdle() && queued && dc.pipe == pipe) { /* the decoder has finished the current song; make it decode the next song */ |