From 8671896e4cd00903bb46ab61a65dfc231273a56a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 11 Jul 2024 16:28:42 +0200 Subject: [PATCH] decoder/Thread: throw StopDecoder if command==STOP in decoder_run_stream() Everybody else is doing that, so let's do the same and not pretend playback was successful. --- src/decoder/Thread.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/decoder/Thread.cxx b/src/decoder/Thread.cxx index 0713540a6..b79cc9e27 100644 --- a/src/decoder/Thread.cxx +++ b/src/decoder/Thread.cxx @@ -304,10 +304,12 @@ decoder_run_stream(DecoderBridge &bridge, const char *uri) std::unique_lock lock{dc.mutex}; + if (bridge.dc.command == DecoderCommand::STOP) + throw StopDecoder(); + bool tried = false; - return dc.command == DecoderCommand::STOP || - decoder_run_stream_locked(bridge, *input_stream, lock, uri, - tried) || + return decoder_run_stream_locked(bridge, *input_stream, lock, uri, + tried) || /* fallback to mp3: this is needed for bastard streams that don't have a suffix or set the mimeType */ (!tried &&