aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/DecoderThread.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/decoder/DecoderThread.cxx')
-rw-r--r--src/decoder/DecoderThread.cxx15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/decoder/DecoderThread.cxx b/src/decoder/DecoderThread.cxx
index b4362a548..2a7275a68 100644
--- a/src/decoder/DecoderThread.cxx
+++ b/src/decoder/DecoderThread.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -60,14 +60,14 @@ decoder_command_finished_locked(DecoderControl &dc)
}
/**
- * Opens the input stream with input_stream::Open(), and waits until
+ * Opens the input stream with InputStream::Open(), and waits until
* the stream gets ready. If a decoder STOP command is received
* during that, it cancels the operation (but does not close the
* stream).
*
* Unlock the decoder before calling this function.
*
- * @return an input_stream on success or if #DecoderCommand::STOP is
+ * @return an InputStream on success or if #DecoderCommand::STOP is
* received, nullptr on error
*/
static InputStream *
@@ -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
@@ -385,13 +383,12 @@ decoder_run_song(DecoderControl &dc,
tags on "stream" songs are just remembered
from the last time we played it*/
song.IsFile() ? new Tag(song.GetTag()) : nullptr);
- 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);