Commit 09157c31 authored by Max Kellermann's avatar Max Kellermann

decoder/Thread: use ScopeLock in decoder_run_stream()

parent 00626b16
...@@ -281,20 +281,16 @@ decoder_run_stream(Decoder &decoder, const char *uri) ...@@ -281,20 +281,16 @@ decoder_run_stream(Decoder &decoder, const char *uri)
if (input_stream == nullptr) if (input_stream == nullptr)
return false; return false;
dc.Lock(); const ScopeLock protect(dc.mutex);
bool tried = false; bool tried = false;
const bool success = dc.command == DecoderCommand::STOP || return dc.command == DecoderCommand::STOP ||
decoder_run_stream_locked(decoder, *input_stream, uri, decoder_run_stream_locked(decoder, *input_stream, uri,
tried) || tried) ||
/* fallback to mp3: this is needed for bastard streams /* fallback to mp3: this is needed for bastard streams
that don't have a suffix or set the mimeType */ that don't have a suffix or set the mimeType */
(!tried && (!tried &&
decoder_run_stream_fallback(decoder, *input_stream)); decoder_run_stream_fallback(decoder, *input_stream));
dc.Unlock();
return success;
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment