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

This commit is contained in:
Max Kellermann 2016-11-24 14:09:58 +01:00
parent 509f62f68d
commit b677e891b4
4 changed files with 6 additions and 8 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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

View File

@ -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" {