summaryrefslogtreecommitdiff
path: root/test/run_decoder.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-07-12 17:49:12 +0200
committerMax Kellermann <max@musicpd.org>2019-07-12 17:49:12 +0200
commitd8aec4b2dc8a709a078bbce44e3a9f5866065a59 (patch)
tree0a4ce07388acf6a6ef0042b4b57c83559000cd4a /test/run_decoder.cxx
parent39b302dcad888dd38b282c761233d293bb6d4e5f (diff)
test/run_decoder: catch StopDecoder
This exception is usually thrown by class DecoderBridge, but the Opus plugin (ab)uses it as well, so we need to catch it.
Diffstat (limited to 'test/run_decoder.cxx')
-rw-r--r--test/run_decoder.cxx11
1 files changed, 9 insertions, 2 deletions
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;