decoder/{mikmod,modplug}: throw exception instead of calling FatalError()
This commit is contained in:
parent
509f62f68d
commit
b677e891b4
@ -21,9 +21,9 @@
|
|||||||
#include "MikmodDecoderPlugin.hxx"
|
#include "MikmodDecoderPlugin.hxx"
|
||||||
#include "../DecoderAPI.hxx"
|
#include "../DecoderAPI.hxx"
|
||||||
#include "tag/TagHandler.hxx"
|
#include "tag/TagHandler.hxx"
|
||||||
#include "system/FatalError.hxx"
|
|
||||||
#include "fs/Path.hxx"
|
#include "fs/Path.hxx"
|
||||||
#include "util/Domain.hxx"
|
#include "util/Domain.hxx"
|
||||||
|
#include "util/RuntimeError.hxx"
|
||||||
#include "Log.hxx"
|
#include "Log.hxx"
|
||||||
|
|
||||||
#include <mikmod.h>
|
#include <mikmod.h>
|
||||||
@ -116,8 +116,8 @@ mikmod_decoder_init(const ConfigBlock &block)
|
|||||||
mikmod_loop = block.GetBlockValue("loop", false);
|
mikmod_loop = block.GetBlockValue("loop", false);
|
||||||
mikmod_sample_rate = block.GetBlockValue("sample_rate", 44100u);
|
mikmod_sample_rate = block.GetBlockValue("sample_rate", 44100u);
|
||||||
if (!audio_valid_sample_rate(mikmod_sample_rate))
|
if (!audio_valid_sample_rate(mikmod_sample_rate))
|
||||||
FormatFatalError("Invalid sample rate in line %d: %u",
|
throw FormatRuntimeError("Invalid sample rate in line %d: %u",
|
||||||
block.line, mikmod_sample_rate);
|
block.line, mikmod_sample_rate);
|
||||||
|
|
||||||
md_device = 0;
|
md_device = 0;
|
||||||
md_reverb = 0;
|
md_reverb = 0;
|
||||||
|
@ -22,9 +22,9 @@
|
|||||||
#include "../DecoderAPI.hxx"
|
#include "../DecoderAPI.hxx"
|
||||||
#include "input/InputStream.hxx"
|
#include "input/InputStream.hxx"
|
||||||
#include "tag/TagHandler.hxx"
|
#include "tag/TagHandler.hxx"
|
||||||
#include "system/FatalError.hxx"
|
|
||||||
#include "util/WritableBuffer.hxx"
|
#include "util/WritableBuffer.hxx"
|
||||||
#include "util/Domain.hxx"
|
#include "util/Domain.hxx"
|
||||||
|
#include "util/RuntimeError.hxx"
|
||||||
#include "Log.hxx"
|
#include "Log.hxx"
|
||||||
|
|
||||||
#include <libmodplug/modplug.h>
|
#include <libmodplug/modplug.h>
|
||||||
@ -45,8 +45,8 @@ modplug_decoder_init(const ConfigBlock &block)
|
|||||||
{
|
{
|
||||||
modplug_loop_count = block.GetBlockValue("loop_count", 0);
|
modplug_loop_count = block.GetBlockValue("loop_count", 0);
|
||||||
if (modplug_loop_count < -1)
|
if (modplug_loop_count < -1)
|
||||||
FormatFatalError("Invalid loop count in line %d: %i",
|
throw FormatRuntimeError("Invalid loop count in line %d: %i",
|
||||||
block.line, modplug_loop_count);
|
block.line, modplug_loop_count);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
#include "util/FormatString.hxx"
|
#include "util/FormatString.hxx"
|
||||||
#include "util/Domain.hxx"
|
#include "util/Domain.hxx"
|
||||||
#include "system/ByteOrder.hxx"
|
#include "system/ByteOrder.hxx"
|
||||||
#include "system/FatalError.hxx"
|
|
||||||
#include "Log.hxx"
|
#include "Log.hxx"
|
||||||
|
|
||||||
#ifdef HAVE_SIDPLAYFP
|
#ifdef HAVE_SIDPLAYFP
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
#include "fs/AllocatedPath.hxx"
|
#include "fs/AllocatedPath.hxx"
|
||||||
#include "fs/FileSystem.hxx"
|
#include "fs/FileSystem.hxx"
|
||||||
#include "fs/Path.hxx"
|
#include "fs/Path.hxx"
|
||||||
#include "system/FatalError.hxx"
|
|
||||||
#include "Log.hxx"
|
#include "Log.hxx"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
Loading…
Reference in New Issue
Block a user