decoder/thread: use typedef InputStreamPtr

This commit is contained in:
Max Kellermann 2016-02-23 10:58:16 +01:00
parent 196de8c758
commit 1b58bd64ff

View File

@ -55,11 +55,10 @@ static constexpr Domain decoder_thread_domain("decoder_thread");
* @return an InputStream on success or if #DecoderCommand::STOP is
* received, nullptr on error
*/
static std::unique_ptr<InputStream>
static InputStreamPtr
decoder_input_stream_open(DecoderControl &dc, const char *uri, Error &error)
{
std::unique_ptr<InputStream> is(InputStream::Open(uri, dc.mutex,
dc.cond, error));
auto is = InputStream::Open(uri, dc.mutex, dc.cond, error);
if (is == nullptr)
return nullptr;
@ -82,11 +81,10 @@ decoder_input_stream_open(DecoderControl &dc, const char *uri, Error &error)
return is;
}
static std::unique_ptr<InputStream>
static InputStreamPtr
decoder_input_stream_open(DecoderControl &dc, Path path, Error &error)
{
std::unique_ptr<InputStream> is(OpenLocalInputStream(path, dc.mutex,
dc.cond, error));
auto is = OpenLocalInputStream(path, dc.mutex, dc.cond, error);
if (is == nullptr)
return nullptr;
@ -263,8 +261,7 @@ decoder_run_stream(Decoder &decoder, const char *uri)
{
DecoderControl &dc = decoder.dc;
std::unique_ptr<InputStream> input_stream =
decoder_input_stream_open(dc, uri, decoder.error);
auto input_stream = decoder_input_stream_open(dc, uri, decoder.error);
if (input_stream == nullptr)
return false;
@ -312,8 +309,8 @@ TryDecoderFile(Decoder &decoder, Path path_fs, const char *suffix,
const ScopeLock protect(dc.mutex);
return decoder_file_decode(plugin, decoder, path_fs);
} else if (plugin.stream_decode != nullptr) {
std::unique_ptr<InputStream> input_stream =
decoder_input_stream_open(dc, path_fs, decoder.error);
auto input_stream = decoder_input_stream_open(dc, path_fs,
decoder.error);
if (input_stream == nullptr)
/* returning true to stop the search for
another decoder plugin */