TagFile: allow ScanFileTags*() to throw
This commit is contained in:
@@ -51,36 +51,29 @@ public:
|
||||
return plugin.ScanFile(path_fs, handler);
|
||||
}
|
||||
|
||||
bool ScanStream(const DecoderPlugin &plugin) noexcept {
|
||||
bool ScanStream(const DecoderPlugin &plugin) {
|
||||
if (plugin.scan_stream == nullptr)
|
||||
return false;
|
||||
|
||||
/* open the InputStream (if not already open) */
|
||||
if (is == nullptr) {
|
||||
try {
|
||||
is = OpenLocalInputStream(path_fs, mutex);
|
||||
} catch (...) {
|
||||
return false;
|
||||
}
|
||||
is = OpenLocalInputStream(path_fs, mutex);
|
||||
} else {
|
||||
try {
|
||||
is->LockRewind();
|
||||
} catch (...) {
|
||||
}
|
||||
is->LockRewind();
|
||||
}
|
||||
|
||||
/* now try the stream_tag() method */
|
||||
return plugin.ScanStream(*is, handler);
|
||||
}
|
||||
|
||||
bool Scan(const DecoderPlugin &plugin) noexcept {
|
||||
bool Scan(const DecoderPlugin &plugin) {
|
||||
return plugin.SupportsSuffix(suffix) &&
|
||||
(ScanFile(plugin) || ScanStream(plugin));
|
||||
}
|
||||
};
|
||||
|
||||
bool
|
||||
ScanFileTagsNoGeneric(Path path_fs, TagHandler &handler) noexcept
|
||||
ScanFileTagsNoGeneric(Path path_fs, TagHandler &handler)
|
||||
{
|
||||
assert(!path_fs.IsNull());
|
||||
|
||||
@@ -100,7 +93,7 @@ ScanFileTagsNoGeneric(Path path_fs, TagHandler &handler) noexcept
|
||||
|
||||
bool
|
||||
ScanFileTagsWithGeneric(Path path, TagBuilder &builder,
|
||||
AudioFormat *audio_format) noexcept
|
||||
AudioFormat *audio_format)
|
||||
{
|
||||
FullTagHandler h(builder, audio_format);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user