aboutsummaryrefslogtreecommitdiffstats
path: root/src/DecoderThread.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-23 22:08:59 +0200
committerMax Kellermann <max@duempel.org>2013-10-23 23:12:02 +0200
commit93deb844996120b6326345d6d87e803142dd1968 (patch)
treed6c00669efffad1b15fc45e03158d6838a7e5827 /src/DecoderThread.cxx
parentc4d4011c63808a64ca20a4b03fd455a83c23cc33 (diff)
downloadmpd-93deb844996120b6326345d6d87e803142dd1968.tar.gz
mpd-93deb844996120b6326345d6d87e803142dd1968.tar.xz
mpd-93deb844996120b6326345d6d87e803142dd1968.zip
input_stream: rename struct to InputStream
Diffstat (limited to 'src/DecoderThread.cxx')
-rw-r--r--src/DecoderThread.cxx33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/DecoderThread.cxx b/src/DecoderThread.cxx
index 3364f23b3..513fdb663 100644
--- a/src/DecoderThread.cxx
+++ b/src/DecoderThread.cxx
@@ -67,12 +67,12 @@ decoder_command_finished_locked(decoder_control &dc)
* @return an input_stream on success or if #DecoderCommand::STOP is
* received, nullptr on error
*/
-static struct input_stream *
+static InputStream *
decoder_input_stream_open(decoder_control &dc, const char *uri)
{
Error error;
- input_stream *is = input_stream::Open(uri, dc.mutex, dc.cond, error);
+ InputStream *is = InputStream::Open(uri, dc.mutex, dc.cond, error);
if (is == nullptr) {
if (error.IsDefined())
LogError(error);
@@ -108,13 +108,12 @@ decoder_input_stream_open(decoder_control &dc, const char *uri)
static bool
decoder_stream_decode(const DecoderPlugin &plugin,
Decoder &decoder,
- struct input_stream *input_stream)
+ InputStream &input_stream)
{
assert(plugin.stream_decode != nullptr);
assert(decoder.stream_tag == nullptr);
assert(decoder.decoder_tag == nullptr);
- assert(input_stream != nullptr);
- assert(input_stream->ready);
+ assert(input_stream.ready);
assert(decoder.dc.state == DecoderState::START);
FormatDebug(decoder_thread_domain, "probing plugin %s", plugin.name);
@@ -123,11 +122,11 @@ decoder_stream_decode(const DecoderPlugin &plugin,
return true;
/* rewind the stream, so each plugin gets a fresh start */
- input_stream->Rewind(IgnoreError());
+ input_stream.Rewind(IgnoreError());
decoder.dc.Unlock();
- plugin.StreamDecode(decoder, *input_stream);
+ plugin.StreamDecode(decoder, input_stream);
decoder.dc.Lock();
@@ -167,7 +166,7 @@ decoder_file_decode(const DecoderPlugin &plugin,
gcc_pure
static bool
-decoder_check_plugin_mime(const DecoderPlugin &plugin, const input_stream &is)
+decoder_check_plugin_mime(const DecoderPlugin &plugin, const InputStream &is)
{
assert(plugin.stream_decode != nullptr);
@@ -185,7 +184,7 @@ decoder_check_plugin_suffix(const DecoderPlugin &plugin, const char *suffix)
gcc_pure
static bool
-decoder_check_plugin(const DecoderPlugin &plugin, const input_stream &is,
+decoder_check_plugin(const DecoderPlugin &plugin, const InputStream &is,
const char *suffix)
{
return plugin.stream_decode != nullptr &&
@@ -194,7 +193,7 @@ decoder_check_plugin(const DecoderPlugin &plugin, const input_stream &is,
}
static bool
-decoder_run_stream_plugin(Decoder &decoder, input_stream &is,
+decoder_run_stream_plugin(Decoder &decoder, InputStream &is,
const char *suffix,
const DecoderPlugin &plugin,
bool &tried_r)
@@ -203,11 +202,11 @@ decoder_run_stream_plugin(Decoder &decoder, input_stream &is,
return false;
tried_r = true;
- return decoder_stream_decode(plugin, decoder, &is);
+ return decoder_stream_decode(plugin, decoder, is);
}
static bool
-decoder_run_stream_locked(Decoder &decoder, input_stream &is,
+decoder_run_stream_locked(Decoder &decoder, InputStream &is,
const char *uri, bool &tried_r)
{
const char *const suffix = uri_get_suffix(uri);
@@ -223,7 +222,7 @@ decoder_run_stream_locked(Decoder &decoder, input_stream &is,
* Try decoding a stream, using the fallback plugin.
*/
static bool
-decoder_run_stream_fallback(Decoder &decoder, struct input_stream *is)
+decoder_run_stream_fallback(Decoder &decoder, InputStream &is)
{
const struct DecoderPlugin *plugin;
@@ -239,7 +238,7 @@ static bool
decoder_run_stream(Decoder &decoder, const char *uri)
{
decoder_control &dc = decoder.dc;
- struct input_stream *input_stream;
+ InputStream *input_stream;
bool success;
dc.Unlock();
@@ -259,7 +258,7 @@ decoder_run_stream(Decoder &decoder, const char *uri)
/* 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));
+ decoder_run_stream_fallback(decoder, *input_stream));
dc.Unlock();
input_stream->Close();
@@ -306,7 +305,7 @@ decoder_run_file(Decoder &decoder, const char *path_fs)
dc.Unlock();
} else if (plugin->stream_decode != nullptr) {
- struct input_stream *input_stream;
+ InputStream *input_stream;
bool success;
input_stream = decoder_input_stream_open(dc, path_fs);
@@ -316,7 +315,7 @@ decoder_run_file(Decoder &decoder, const char *path_fs)
dc.Lock();
success = decoder_stream_decode(*plugin, decoder,
- input_stream);
+ *input_stream);
dc.Unlock();