summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/RunChromaprint.cxx12
-rw-r--r--test/run_decoder.cxx11
2 files changed, 18 insertions, 5 deletions
diff --git a/test/RunChromaprint.cxx b/test/RunChromaprint.cxx
index b04bf9060..a28c6336f 100644
--- a/test/RunChromaprint.cxx
+++ b/test/RunChromaprint.cxx
@@ -23,7 +23,7 @@
#include "event/Thread.hxx"
#include "decoder/DecoderList.hxx"
#include "decoder/DecoderPlugin.hxx"
-#include "decoder/Client.hxx"
+#include "decoder/DecoderAPI.hxx" /* for class StopDecoder */
#include "input/Init.hxx"
#include "input/InputStream.hxx"
#include "fs/Path.hxx"
@@ -244,10 +244,16 @@ try {
ChromaprintDecoderClient 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;
diff --git a/test/run_decoder.cxx b/test/run_decoder.cxx
index c94b5ee07..f7e3d6739 100644
--- a/test/run_decoder.cxx
+++ b/test/run_decoder.cxx
@@ -21,6 +21,7 @@
#include "event/Thread.hxx"
#include "decoder/DecoderList.hxx"
#include "decoder/DecoderPlugin.hxx"
+#include "decoder/DecoderAPI.hxx" /* for class StopDecoder */
#include "DumpDecoderClient.hxx"
#include "input/Init.hxx"
#include "input/InputStream.hxx"
@@ -116,10 +117,16 @@ try {
DumpDecoderClient 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;