From bfdf13dca365fb6ac9a5912d6a1a9efb08b2e361 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 6 Jul 2020 13:36:22 +0200 Subject: decoder/Plugin: allow scan_{file,stream}() to throw Bug #915 is about an I/O exception thrown where none was allowed, leading to crash via std::terminate(). However, instead of catching and logging the error inside the decoder plugin, it should be able to propagate the I/O error to the MPD core, so MPD can avoid trying other decoder plugins. Closes https://github.com/MusicPlayerDaemon/MPD/issues/915 --- src/TagFile.hxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/TagFile.hxx') diff --git a/src/TagFile.hxx b/src/TagFile.hxx index 691c3569b..98cbb8bce 100644 --- a/src/TagFile.hxx +++ b/src/TagFile.hxx @@ -30,22 +30,26 @@ class TagBuilder; * but does not fall back to generic scanners (APE and ID3) if no tags * were found (but the file was recognized). * + * Throws on I/O error. + * * @return true if the file was recognized (even if no metadata was * found) */ bool -ScanFileTagsNoGeneric(Path path, TagHandler &handler) noexcept; +ScanFileTagsNoGeneric(Path path, TagHandler &handler); /** * Scan the tags of a song file. Invokes matching decoder plugins, * and falls back to generic scanners (APE and ID3) if no tags were * found (but the file was recognized). * + * Throws on I/O error. + * * @return true if the file was recognized (even if no metadata was * found) */ bool ScanFileTagsWithGeneric(Path path, TagBuilder &builder, - AudioFormat *audio_format=nullptr) noexcept; + AudioFormat *audio_format=nullptr); #endif -- cgit v1.2.3