From 4684d05fa6f2e43f4c579df0dc933ab23f0a1ebb Mon Sep 17 00:00:00 2001
From: Max Kellermann <max.kellermann@gmail.com>
Date: Mon, 6 May 2024 17:38:23 +0200
Subject: [PATCH] player/Thread: reset the `decoder_starting` flag in
 StopDecoder()

Fixes crash bug (assertion failure) if a new "play" command is handled
while the player thread waits for decoder startup.
---
 src/player/Thread.cxx | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/player/Thread.cxx b/src/player/Thread.cxx
index c92ce3d85..4449374d6 100644
--- a/src/player/Thread.cxx
+++ b/src/player/Thread.cxx
@@ -400,6 +400,8 @@ Player::StopDecoder(std::unique_lock<Mutex> &lock) noexcept
 		   pipe */
 		ResetCrossFade();
 	}
+
+	decoder_starting = false;
 }
 
 bool