Merge branch 'v0.21.x'

This commit is contained in:
Max Kellermann
2019-07-29 11:15:04 +02:00
7 changed files with 69 additions and 14 deletions

View File

@@ -23,6 +23,7 @@
#include "event/Thread.hxx"
#include "decoder/DecoderList.hxx"
#include "decoder/DecoderPlugin.hxx"
#include "decoder/DecoderAPI.hxx" /* for class StopDecoder */
#include "input/Init.hxx"
#include "input/InputStream.hxx"
#include "fs/Path.hxx"
@@ -126,10 +127,16 @@ try {
MyChromaprintDecoderClient client;
if (plugin->file_decode != nullptr) {
plugin->FileDecode(client, Path::FromFS(c.uri));
try {
plugin->FileDecode(client, Path::FromFS(c.uri));
} catch (StopDecoder) {
}
} else if (plugin->stream_decode != nullptr) {
auto is = InputStream::OpenReady(c.uri, client.mutex);
plugin->StreamDecode(client, *is);
try {
plugin->StreamDecode(client, *is);
} catch (StopDecoder) {
}
} else {
fprintf(stderr, "Decoder plugin is not usable\n");
return EXIT_FAILURE;