diff options
author | Max Kellermann <max@musicpd.org> | 2020-07-06 13:36:22 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2020-07-06 14:13:34 +0200 |
commit | bfdf13dca365fb6ac9a5912d6a1a9efb08b2e361 (patch) | |
tree | 2f92b7a8c247b8cb70093e29d4d4d8baafa37f76 /src/TagFile.hxx | |
parent | daefc61aa4f603418a28994343bf21e335b2e94e (diff) |
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
Diffstat (limited to 'src/TagFile.hxx')
-rw-r--r-- | src/TagFile.hxx | 8 |
1 files changed, 6 insertions, 2 deletions
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 |