decoder/wildmidi: throw PluginUnavailable on WildMidi_Init() error
Closes https://github.com/MusicPlayerDaemon/MPD/issues/589
This commit is contained in:
parent
0abaa3ecc5
commit
ea639269d8
2
NEWS
2
NEWS
|
@ -1,4 +1,6 @@
|
||||||
ver 0.21.11 (not yet released)
|
ver 0.21.11 (not yet released)
|
||||||
|
* decoder
|
||||||
|
- wildmidi: log error if library initialization fails
|
||||||
* output
|
* output
|
||||||
- alsa, osx: fix distortions with DSD_U32 and DoP on 32 bit CPUs
|
- alsa, osx: fix distortions with DSD_U32 and DoP on 32 bit CPUs
|
||||||
* protocol
|
* protocol
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "../DecoderAPI.hxx"
|
#include "../DecoderAPI.hxx"
|
||||||
#include "tag/Handler.hxx"
|
#include "tag/Handler.hxx"
|
||||||
#include "util/Domain.hxx"
|
#include "util/Domain.hxx"
|
||||||
|
#include "util/ScopeExit.hxx"
|
||||||
#include "util/StringFormat.hxx"
|
#include "util/StringFormat.hxx"
|
||||||
#include "fs/AllocatedPath.hxx"
|
#include "fs/AllocatedPath.hxx"
|
||||||
#include "fs/FileSystem.hxx"
|
#include "fs/FileSystem.hxx"
|
||||||
|
@ -49,8 +50,14 @@ wildmidi_init(const ConfigBlock &block)
|
||||||
utf8.c_str()));
|
utf8.c_str()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return WildMidi_Init(path.c_str(), wildmidi_audio_format.sample_rate,
|
WildMidi_ClearError();
|
||||||
0) == 0;
|
AtScopeExit() { WildMidi_ClearError(); };
|
||||||
|
|
||||||
|
if (WildMidi_Init(path.c_str(), wildmidi_audio_format.sample_rate,
|
||||||
|
0) != 0)
|
||||||
|
throw PluginUnavailable(WildMidi_GetError());
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue