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.
This commit is contained in:
@@ -970,6 +970,15 @@ Player::Run() noexcept
|
|||||||
pc.CommandFinished();
|
pc.CommandFinished();
|
||||||
|
|
||||||
while (ProcessCommand()) {
|
while (ProcessCommand()) {
|
||||||
|
if (decoder_starting) {
|
||||||
|
/* wait until the decoder is initialized completely */
|
||||||
|
|
||||||
|
if (!CheckDecoderStartup())
|
||||||
|
break;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (buffering) {
|
if (buffering) {
|
||||||
/* buffering at the start of the song - wait
|
/* buffering at the start of the song - wait
|
||||||
until the buffer is large enough, to
|
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) {
|
if (dc.IsIdle() && queued && dc.pipe == pipe) {
|
||||||
/* the decoder has finished the current song;
|
/* the decoder has finished the current song;
|
||||||
make it decode the next song */
|
make it decode the next song */
|
||||||
|
Reference in New Issue
Block a user