InputLegacy: move functions to the input_stream class

This commit is contained in:
Max Kellermann
2013-09-05 00:06:31 +02:00
parent 52ffdb0a55
commit 7d0269d2ce
47 changed files with 461 additions and 608 deletions

View File

@@ -22,7 +22,7 @@
#include "DecoderList.hxx"
#include "DecoderAPI.hxx"
#include "InputInit.hxx"
#include "InputLegacy.hxx"
#include "InputStream.hxx"
#include "AudioFormat.hxx"
#include "util/Error.hxx"
#include "stdbin.h"
@@ -92,8 +92,7 @@ decoder_read(gcc_unused struct decoder *decoder,
struct input_stream *is,
void *buffer, size_t length)
{
Error error;
return input_stream_lock_read(is, buffer, length, error);
return is->LockRead(buffer, length, IgnoreError());
}
void
@@ -189,20 +188,20 @@ int main(int argc, char **argv)
Mutex mutex;
Cond cond;
struct input_stream *is =
input_stream_open(decoder.uri, mutex, cond, error);
input_stream *is =
input_stream::Open(decoder.uri, mutex, cond, error);
if (is == NULL) {
if (error.IsDefined())
g_warning("%s", error.GetMessage());
else
g_printerr("input_stream_open() failed\n");
g_printerr("input_stream::Open() failed\n");
return 1;
}
decoder_plugin_stream_decode(decoder.plugin, &decoder, is);
input_stream_close(is);
is->Close();
} else {
g_printerr("Decoder plugin is not usable\n");
return 1;