mpd/src/player
Max Kellermann 7236f83999 player/Thread: do not start the decoder twice
Upon receiving PlayerCommand::QUEUE, call StartDecoder() only if the
decoder is not already starting.  Checking just
DecoderControl::IsIdle() is not enough because the decoder may already
have finished decoding the song before the player has started playing
it and before it had a chance to call CheckDecoderStartup().

Omitting the StartDecoder() call now means it will be started later in
the Run() main loop, after CheckDecoderStartup() has succeeded (which
effectively switches to the song that has already been decoded by the
current decoder).

This fixes an assertion failure when compiled in debug mode
(`-Db_ndebug=false`) and random noise playback in non-debug mode
(`-Db_ndebug=true`).

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1900
2024-04-15 21:39:53 +02:00
..
Control.cxx use SPDX IDs, replacing the long copyright headers 2023-03-06 14:59:48 +01:00
Control.hxx use SPDX IDs, replacing the long copyright headers 2023-03-06 14:59:48 +01:00
CrossFade.cxx util/NumberParser: rename to CNumberParser 2024-01-04 21:02:45 +01:00
CrossFade.hxx use SPDX IDs, replacing the long copyright headers 2023-03-06 14:59:48 +01:00
Listener.hxx use SPDX IDs, replacing the long copyright headers 2023-03-06 14:59:48 +01:00
Outputs.hxx use SPDX IDs, replacing the long copyright headers 2023-03-06 14:59:48 +01:00
Thread.cxx player/Thread: do not start the decoder twice 2024-04-15 21:39:53 +02:00