diff options
author | Max Kellermann <max@duempel.org> | 2015-01-31 22:20:38 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-01-31 22:20:38 +0100 |
commit | ee6e0e16cbcc7b2f169dca3ef88cb04b9c07467a (patch) | |
tree | c870797babb4894c13e44c8aa273cd0363bb3182 | |
parent | eb1733609ad9a0842ba1c77b1c375507929f9585 (diff) | |
download | mpd-ee6e0e16cbcc7b2f169dca3ef88cb04b9c07467a.tar.gz mpd-ee6e0e16cbcc7b2f169dca3ef88cb04b9c07467a.tar.xz mpd-ee6e0e16cbcc7b2f169dca3ef88cb04b9c07467a.zip |
DecoderThread: make variables more local
-rw-r--r-- | src/decoder/DecoderThread.cxx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/decoder/DecoderThread.cxx b/src/decoder/DecoderThread.cxx index 9ce3ed096..98a8de540 100644 --- a/src/decoder/DecoderThread.cxx +++ b/src/decoder/DecoderThread.cxx @@ -267,12 +267,10 @@ static bool decoder_run_stream(Decoder &decoder, const char *uri) { DecoderControl &dc = decoder.dc; - InputStream *input_stream; - bool success; dc.Unlock(); - input_stream = decoder_input_stream_open(dc, uri); + InputStream *input_stream = decoder_input_stream_open(dc, uri); if (input_stream == nullptr) { dc.Lock(); return false; @@ -281,7 +279,7 @@ decoder_run_stream(Decoder &decoder, const char *uri) dc.Lock(); bool tried = false; - success = dc.command == DecoderCommand::STOP || + const bool success = dc.command == DecoderCommand::STOP || decoder_run_stream_locked(decoder, *input_stream, uri, tried) || /* fallback to mp3: this is needed for bastard streams @@ -381,13 +379,12 @@ decoder_run_song(DecoderControl &dc, { Decoder decoder(dc, dc.start_time.IsPositive(), new Tag(song.GetTag())); - int ret; dc.state = DecoderState::START; decoder_command_finished_locked(dc); - ret = !path_fs.IsNull() + const int ret = !path_fs.IsNull() ? decoder_run_file(decoder, uri, path_fs) : decoder_run_stream(decoder, uri); |