input/Plugin: migrate open() from class Error to C++ exceptions
This commit is contained in:
@@ -26,7 +26,6 @@
|
||||
#include "input/InputStream.hxx"
|
||||
#include "fs/Path.hxx"
|
||||
#include "AudioFormat.hxx"
|
||||
#include "util/Error.hxx"
|
||||
#include "Log.hxx"
|
||||
|
||||
#include <stdexcept>
|
||||
@@ -49,7 +48,6 @@ try {
|
||||
|
||||
const ScopeIOThread io_thread;
|
||||
|
||||
Error error;
|
||||
input_stream_global_init();
|
||||
|
||||
decoder_plugin_init_all();
|
||||
@@ -64,16 +62,7 @@ try {
|
||||
plugin->FileDecode(decoder, Path::FromFS(uri));
|
||||
} else if (plugin->stream_decode != nullptr) {
|
||||
auto is = InputStream::OpenReady(uri, decoder.mutex,
|
||||
decoder.cond, error);
|
||||
if (!is) {
|
||||
if (error.IsDefined())
|
||||
LogError(error);
|
||||
else
|
||||
fprintf(stderr, "InputStream::Open() failed\n");
|
||||
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
decoder.cond);
|
||||
plugin->StreamDecode(decoder, *is);
|
||||
} else {
|
||||
fprintf(stderr, "Decoder plugin is not usable\n");
|
||||
|
Reference in New Issue
Block a user