summaryrefslogtreecommitdiff
path: root/src/decoder
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2016-11-24 14:09:58 +0100
committerMax Kellermann <max@musicpd.org>2016-11-24 14:09:58 +0100
commitb677e891b4caee26eb898398b6cb85702cd302c8 (patch)
treeefbd0e2ee993d5f51993417fd4b10372132ad69c /src/decoder
parent509f62f68dcca5d8749c955925072b59b9006824 (diff)
decoder/{mikmod,modplug}: throw exception instead of calling FatalError()
Diffstat (limited to 'src/decoder')
-rw-r--r--src/decoder/plugins/MikmodDecoderPlugin.cxx6
-rw-r--r--src/decoder/plugins/ModplugDecoderPlugin.cxx6
-rw-r--r--src/decoder/plugins/SidplayDecoderPlugin.cxx1
-rw-r--r--src/decoder/plugins/WildmidiDecoderPlugin.cxx1
4 files changed, 6 insertions, 8 deletions
diff --git a/src/decoder/plugins/MikmodDecoderPlugin.cxx b/src/decoder/plugins/MikmodDecoderPlugin.cxx
index c01408ccf..5838d6fe7 100644
--- a/src/decoder/plugins/MikmodDecoderPlugin.cxx
+++ b/src/decoder/plugins/MikmodDecoderPlugin.cxx
@@ -21,9 +21,9 @@
#include "MikmodDecoderPlugin.hxx"
#include "../DecoderAPI.hxx"
#include "tag/TagHandler.hxx"
-#include "system/FatalError.hxx"
#include "fs/Path.hxx"
#include "util/Domain.hxx"
+#include "util/RuntimeError.hxx"
#include "Log.hxx"
#include <mikmod.h>
@@ -116,8 +116,8 @@ mikmod_decoder_init(const ConfigBlock &block)
mikmod_loop = block.GetBlockValue("loop", false);
mikmod_sample_rate = block.GetBlockValue("sample_rate", 44100u);
if (!audio_valid_sample_rate(mikmod_sample_rate))
- FormatFatalError("Invalid sample rate in line %d: %u",
- block.line, mikmod_sample_rate);
+ throw FormatRuntimeError("Invalid sample rate in line %d: %u",
+ block.line, mikmod_sample_rate);
md_device = 0;
md_reverb = 0;
diff --git a/src/decoder/plugins/ModplugDecoderPlugin.cxx b/src/decoder/plugins/ModplugDecoderPlugin.cxx
index 7e114c05a..97e5f87b4 100644
--- a/src/decoder/plugins/ModplugDecoderPlugin.cxx
+++ b/src/decoder/plugins/ModplugDecoderPlugin.cxx
@@ -22,9 +22,9 @@
#include "../DecoderAPI.hxx"
#include "input/InputStream.hxx"
#include "tag/TagHandler.hxx"
-#include "system/FatalError.hxx"
#include "util/WritableBuffer.hxx"
#include "util/Domain.hxx"
+#include "util/RuntimeError.hxx"
#include "Log.hxx"
#include <libmodplug/modplug.h>
@@ -45,8 +45,8 @@ modplug_decoder_init(const ConfigBlock &block)
{
modplug_loop_count = block.GetBlockValue("loop_count", 0);
if (modplug_loop_count < -1)
- FormatFatalError("Invalid loop count in line %d: %i",
- block.line, modplug_loop_count);
+ throw FormatRuntimeError("Invalid loop count in line %d: %i",
+ block.line, modplug_loop_count);
return true;
}
diff --git a/src/decoder/plugins/SidplayDecoderPlugin.cxx b/src/decoder/plugins/SidplayDecoderPlugin.cxx
index b7edd9a95..7b87f45de 100644
--- a/src/decoder/plugins/SidplayDecoderPlugin.cxx
+++ b/src/decoder/plugins/SidplayDecoderPlugin.cxx
@@ -29,7 +29,6 @@
#include "util/FormatString.hxx"
#include "util/Domain.hxx"
#include "system/ByteOrder.hxx"
-#include "system/FatalError.hxx"
#include "Log.hxx"
#ifdef HAVE_SIDPLAYFP
diff --git a/src/decoder/plugins/WildmidiDecoderPlugin.cxx b/src/decoder/plugins/WildmidiDecoderPlugin.cxx
index a8db10dec..37404946b 100644
--- a/src/decoder/plugins/WildmidiDecoderPlugin.cxx
+++ b/src/decoder/plugins/WildmidiDecoderPlugin.cxx
@@ -25,7 +25,6 @@
#include "fs/AllocatedPath.hxx"
#include "fs/FileSystem.hxx"
#include "fs/Path.hxx"
-#include "system/FatalError.hxx"
#include "Log.hxx"
extern "C" {