From c8ece786dd654cdb81c5e8358be8f0d7c78ff777 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 15 Apr 2024 21:35:43 +0200 Subject: [PATCH] player/Thread: add assert() to StartDecoder() StartDecoder() must not be called when a decoder is still being started. This detects the bug https://github.com/MusicPlayerDaemon/MPD/issues/1900 earlier. --- src/player/Thread.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/player/Thread.cxx b/src/player/Thread.cxx index 6e57ecb4a..01cca7b8f 100644 --- a/src/player/Thread.cxx +++ b/src/player/Thread.cxx @@ -367,6 +367,7 @@ Player::StartDecoder(std::unique_lock &lock, std::shared_ptr _pipe, bool initial_seek_essential) noexcept { + assert(!decoder_starting); assert(queued || pc.command == PlayerCommand::SEEK); assert(pc.next_song != nullptr);