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