Commit 7d789a98 authored by Max Kellermann's avatar Max Kellermann

decoder/Plugin: add "noexcept"

parent d9211148
......@@ -48,7 +48,7 @@ struct DecoderPlugin {
* Deinitialize a decoder plugin which was initialized
* successfully. Optional method.
*/
void (*finish)();
void (*finish)() noexcept;
/**
* Decode a stream (data read from an #InputStream object).
......@@ -73,7 +73,7 @@ struct DecoderPlugin {
*/
bool (*scan_file)(Path path_fs,
const TagHandler &handler,
void *handler_ctx);
void *handler_ctx) noexcept;
/**
* Scan metadata of a file.
......@@ -82,7 +82,7 @@ struct DecoderPlugin {
*/
bool (*scan_stream)(InputStream &is,
const TagHandler &handler,
void *handler_ctx);
void *handler_ctx) noexcept;
/**
* @brief Return a "virtual" filename for subtracks in
......@@ -140,7 +140,7 @@ struct DecoderPlugin {
*/
template<typename P>
bool ScanFile(P path_fs,
const TagHandler &handler, void *handler_ctx) const {
const TagHandler &handler, void *handler_ctx) const noexcept {
return scan_file != nullptr
? scan_file(path_fs, handler, handler_ctx)
: false;
......@@ -150,7 +150,7 @@ struct DecoderPlugin {
* Read the tag of a stream.
*/
bool ScanStream(InputStream &is,
const TagHandler &handler, void *handler_ctx) const {
const TagHandler &handler, void *handler_ctx) const noexcept {
return scan_stream != nullptr
? scan_stream(is, handler, handler_ctx)
: false;
......
......@@ -257,7 +257,7 @@ audiofile_get_duration(InputStream &is) noexcept
static bool
audiofile_scan_stream(InputStream &is,
const TagHandler &handler, void *handler_ctx)
const TagHandler &handler, void *handler_ctx) noexcept
{
const auto duration = audiofile_get_duration(is);
if (duration.IsNegative())
......
......@@ -451,7 +451,7 @@ dsdiff_stream_decode(DecoderClient &client, InputStream &is)
static bool
dsdiff_scan_stream(InputStream &is,
gcc_unused const TagHandler &handler,
gcc_unused void *handler_ctx)
gcc_unused void *handler_ctx) noexcept
{
DsdiffMetaData metadata;
DsdiffChunkHeader chunk_header;
......
......@@ -327,7 +327,7 @@ dsf_stream_decode(DecoderClient &client, InputStream &is)
static bool
dsf_scan_stream(InputStream &is,
gcc_unused const TagHandler &handler,
gcc_unused void *handler_ctx)
gcc_unused void *handler_ctx) noexcept
{
/* check DSF metadata */
DsfMetaData metadata;
......
......@@ -415,7 +415,7 @@ faad_stream_decode(DecoderClient &client, InputStream &is)
static bool
faad_scan_stream(InputStream &is,
const TagHandler &handler, void *handler_ctx)
const TagHandler &handler, void *handler_ctx) noexcept
{
auto result = faad_get_file_time(is);
if (!result.first)
......
......@@ -103,7 +103,7 @@ ffmpeg_init(const ConfigBlock &block)
}
static void
ffmpeg_finish()
ffmpeg_finish() noexcept
{
av_dict_free(&avformat_options);
}
......@@ -856,7 +856,7 @@ FfmpegScanStream(AVFormatContext &format_context,
static bool
ffmpeg_scan_stream(InputStream &is,
const TagHandler &handler, void *handler_ctx)
const TagHandler &handler, void *handler_ctx) noexcept
{
AVInputFormat *input_format = ffmpeg_probe(nullptr, is);
if (input_format == nullptr)
......
......@@ -70,7 +70,7 @@ flac_write_cb(const FLAC__StreamDecoder *dec, const FLAC__Frame *frame,
static bool
flac_scan_file(Path path_fs,
const TagHandler &handler, void *handler_ctx)
const TagHandler &handler, void *handler_ctx) noexcept
{
FlacMetadataChain chain;
if (!chain.Read(NarrowPath(path_fs))) {
......@@ -86,7 +86,7 @@ flac_scan_file(Path path_fs,
static bool
flac_scan_stream(InputStream &is,
const TagHandler &handler, void *handler_ctx)
const TagHandler &handler, void *handler_ctx) noexcept
{
FlacMetadataChain chain;
if (!chain.Read(is)) {
......@@ -290,7 +290,7 @@ oggflac_init(gcc_unused const ConfigBlock &block)
static bool
oggflac_scan_file(Path path_fs,
const TagHandler &handler, void *handler_ctx)
const TagHandler &handler, void *handler_ctx) noexcept
{
FlacMetadataChain chain;
if (!chain.ReadOgg(NarrowPath(path_fs))) {
......@@ -306,7 +306,7 @@ oggflac_scan_file(Path path_fs,
static bool
oggflac_scan_stream(InputStream &is,
const TagHandler &handler, void *handler_ctx)
const TagHandler &handler, void *handler_ctx) noexcept
{
FlacMetadataChain chain;
if (!chain.ReadOgg(is)) {
......
......@@ -194,7 +194,7 @@ fluidsynth_file_decode(DecoderClient &client, Path path_fs)
static bool
fluidsynth_scan_file(Path path_fs,
gcc_unused const TagHandler &handler,
gcc_unused void *handler_ctx)
gcc_unused void *handler_ctx) noexcept
{
return fluid_is_midifile(path_fs.c_str());
}
......
......@@ -282,7 +282,7 @@ ScanMusicEmu(Music_Emu *emu, unsigned song_num,
static bool
gme_scan_file(Path path_fs,
const TagHandler &handler, void *handler_ctx)
const TagHandler &handler, void *handler_ctx) noexcept
{
const auto container = ParseContainerPath(path_fs);
......
......@@ -1063,7 +1063,7 @@ mp3_decode(DecoderClient &client, InputStream &input_stream)
static bool
mad_decoder_scan_stream(InputStream &is,
const TagHandler &handler, void *handler_ctx)
const TagHandler &handler, void *handler_ctx) noexcept
{
const auto result = mad_decoder_total_file_time(is);
if (!result.first)
......
......@@ -141,7 +141,7 @@ mikmod_decoder_init(const ConfigBlock &block)
}
static void
mikmod_decoder_finish(void)
mikmod_decoder_finish() noexcept
{
MikMod_Exit();
}
......@@ -186,7 +186,7 @@ mikmod_decoder_file_decode(DecoderClient &client, Path path_fs)
static bool
mikmod_decoder_scan_file(Path path_fs,
const TagHandler &handler, void *handler_ctx)
const TagHandler &handler, void *handler_ctx) noexcept
{
/* deconstify the path because libmikmod wants a non-const
string pointer */
......
......@@ -176,7 +176,7 @@ mod_decode(DecoderClient &client, InputStream &is)
static bool
modplug_scan_stream(InputStream &is,
const TagHandler &handler, void *handler_ctx)
const TagHandler &handler, void *handler_ctx) noexcept
{
ModPlugFile *f = LoadModPlugFile(nullptr, is);
if (f == nullptr)
......
......@@ -258,7 +258,7 @@ mpcdec_get_file_duration(InputStream &is)
static bool
mpcdec_scan_stream(InputStream &is,
const TagHandler &handler, void *handler_ctx)
const TagHandler &handler, void *handler_ctx) noexcept
{
const auto duration = mpcdec_get_file_duration(is);
if (duration.IsNegative())
......
......@@ -45,7 +45,7 @@ mpd_mpg123_init(gcc_unused const ConfigBlock &block)
}
static void
mpd_mpg123_finish(void)
mpd_mpg123_finish() noexcept
{
mpg123_exit();
}
......@@ -280,7 +280,7 @@ mpd_mpg123_file_decode(DecoderClient &client, Path path_fs)
static bool
mpd_mpg123_scan_file(Path path_fs,
const TagHandler &handler, void *handler_ctx)
const TagHandler &handler, void *handler_ctx) noexcept
{
int error;
mpg123_handle *const handle = mpg123_new(nullptr, &error);
......
......@@ -341,7 +341,7 @@ VisitOpusDuration(InputStream &is, OggSyncState &sync, OggStreamState &stream,
static bool
mpd_opus_scan_stream(InputStream &is,
const TagHandler &handler, void *handler_ctx)
const TagHandler &handler, void *handler_ctx) noexcept
{
InputStreamReader reader(is);
OggSyncState oy(reader);
......
......@@ -262,7 +262,7 @@ static constexpr struct {
static bool
sndfile_scan_stream(InputStream &is,
const TagHandler &handler, void *handler_ctx)
const TagHandler &handler, void *handler_ctx) noexcept
{
SF_INFO info;
......
......@@ -363,7 +363,7 @@ VisitVorbisDuration(InputStream &is,
static bool
vorbis_scan_stream(InputStream &is,
const TagHandler &handler, void *handler_ctx)
const TagHandler &handler, void *handler_ctx) noexcept
{
/* initialize libogg */
......
......@@ -579,7 +579,7 @@ wavpack_filedecode(DecoderClient &client, Path path_fs)
*/
static bool
wavpack_scan_file(Path path_fs,
const TagHandler &handler, void *handler_ctx)
const TagHandler &handler, void *handler_ctx) noexcept
{
auto *wpc = WavpackOpenInput(path_fs, OPEN_DSD_FLAG, 0);
AtScopeExit(wpc) {
......@@ -595,7 +595,7 @@ wavpack_scan_file(Path path_fs,
static bool
wavpack_scan_stream(InputStream &is,
const TagHandler &handler, void *handler_ctx)
const TagHandler &handler, void *handler_ctx) noexcept
{
WavpackInput isp(nullptr, is);
auto *wpc = WavpackOpenInput(&mpd_is_reader, &isp, nullptr,
......
......@@ -54,7 +54,7 @@ wildmidi_init(const ConfigBlock &block)
}
static void
wildmidi_finish(void)
wildmidi_finish() noexcept
{
WildMidi_Shutdown();
}
......@@ -127,7 +127,7 @@ wildmidi_file_decode(DecoderClient &client, Path path_fs)
static bool
wildmidi_scan_file(Path path_fs,
const TagHandler &handler, void *handler_ctx)
const TagHandler &handler, void *handler_ctx) noexcept
{
midi *wm = WildMidi_Open(path_fs.c_str());
if (wm == nullptr)
......
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