diff options
author | Max Kellermann <max@duempel.org> | 2015-12-31 13:01:49 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-12-31 13:01:49 +0100 |
commit | 09157c3130ee8c47192befaa57fd56970e659590 (patch) | |
tree | bece8db81246c526b01af2e9be7b5e8ea0b689ae /src/decoder | |
parent | 00626b1633661c80646bacd2dcddf830330f4e6c (diff) |
decoder/Thread: use ScopeLock in decoder_run_stream()
Diffstat (limited to 'src/decoder')
-rw-r--r-- | src/decoder/DecoderThread.cxx | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/decoder/DecoderThread.cxx b/src/decoder/DecoderThread.cxx index 60ca1e01b..971e4f8a7 100644 --- a/src/decoder/DecoderThread.cxx +++ b/src/decoder/DecoderThread.cxx @@ -281,20 +281,16 @@ decoder_run_stream(Decoder &decoder, const char *uri) if (input_stream == nullptr) return false; - dc.Lock(); + const ScopeLock protect(dc.mutex); bool tried = false; - const bool success = dc.command == DecoderCommand::STOP || + return dc.command == DecoderCommand::STOP || decoder_run_stream_locked(decoder, *input_stream, uri, tried) || /* fallback to mp3: this is needed for bastard streams that don't have a suffix or set the mimeType */ (!tried && decoder_run_stream_fallback(decoder, *input_stream)); - - dc.Unlock(); - - return success; } /** |