TagStream: allow tag_stream_scan() to throw
This commit is contained in:
parent
9a78371b5c
commit
6f1d5105ee
@ -73,14 +73,12 @@ tag_stream_scan(InputStream &is, TagHandler &handler) noexcept
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
tag_stream_scan(const char *uri, TagHandler &handler) noexcept
|
tag_stream_scan(const char *uri, TagHandler &handler)
|
||||||
try {
|
{
|
||||||
Mutex mutex;
|
Mutex mutex;
|
||||||
|
|
||||||
auto is = InputStream::OpenReady(uri, mutex);
|
auto is = InputStream::OpenReady(uri, mutex);
|
||||||
return tag_stream_scan(*is, handler);
|
return tag_stream_scan(*is, handler);
|
||||||
} catch (const std::exception &e) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
@ -102,12 +100,10 @@ tag_stream_scan(InputStream &is, TagBuilder &builder,
|
|||||||
|
|
||||||
bool
|
bool
|
||||||
tag_stream_scan(const char *uri, TagBuilder &builder,
|
tag_stream_scan(const char *uri, TagBuilder &builder,
|
||||||
AudioFormat *audio_format) noexcept
|
AudioFormat *audio_format)
|
||||||
try {
|
{
|
||||||
Mutex mutex;
|
Mutex mutex;
|
||||||
|
|
||||||
auto is = InputStream::OpenReady(uri, mutex);
|
auto is = InputStream::OpenReady(uri, mutex);
|
||||||
return tag_stream_scan(*is, builder, audio_format);
|
return tag_stream_scan(*is, builder, audio_format);
|
||||||
} catch (const std::exception &e) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
@ -35,8 +35,11 @@ class TagBuilder;
|
|||||||
bool
|
bool
|
||||||
tag_stream_scan(InputStream &is, TagHandler &handler) noexcept;
|
tag_stream_scan(InputStream &is, TagHandler &handler) noexcept;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Throws on error.
|
||||||
|
*/
|
||||||
bool
|
bool
|
||||||
tag_stream_scan(const char *uri, TagHandler &handler) noexcept;
|
tag_stream_scan(const char *uri, TagHandler &handler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scan the tags of an #InputStream. Invokes matching decoder
|
* Scan the tags of an #InputStream. Invokes matching decoder
|
||||||
@ -50,8 +53,11 @@ bool
|
|||||||
tag_stream_scan(InputStream &is, TagBuilder &builder,
|
tag_stream_scan(InputStream &is, TagBuilder &builder,
|
||||||
AudioFormat *audio_format=nullptr) noexcept;
|
AudioFormat *audio_format=nullptr) noexcept;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Throws on error.
|
||||||
|
*/
|
||||||
bool
|
bool
|
||||||
tag_stream_scan(const char *uri, TagBuilder &builder,
|
tag_stream_scan(const char *uri, TagBuilder &builder,
|
||||||
AudioFormat *audio_format=nullptr) noexcept;
|
AudioFormat *audio_format=nullptr);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user