Commit b677e891 authored by Max Kellermann's avatar Max Kellermann

decoder/{mikmod,modplug}: throw exception instead of calling FatalError()

parent 509f62f6
......@@ -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;
......
......@@ -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;
}
......
......@@ -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
......
......@@ -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" {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment