Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
31b59a0d
Commit
31b59a0d
authored
May 21, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag/Generic: allow ScanGenericTags() to throw
Propagate the error to the caller instead of logging it.
parent
92f74217
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
14 deletions
+10
-14
Generic.cxx
src/tag/Generic.cxx
+4
-12
Generic.hxx
src/tag/Generic.hxx
+6
-2
No files found.
src/tag/Generic.cxx
View file @
31b59a0d
...
...
@@ -24,23 +24,18 @@
#include "thread/Mutex.hxx"
#include "input/InputStream.hxx"
#include "input/LocalOpen.hxx"
#include "Log.hxx"
#include "config.h"
#include <exception>
bool
ScanGenericTags
(
InputStream
&
is
,
TagHandler
&
handler
)
noexcept
ScanGenericTags
(
InputStream
&
is
,
TagHandler
&
handler
)
{
if
(
tag_ape_scan2
(
is
,
handler
))
return
true
;
#ifdef ENABLE_ID3TAG
try
{
is
.
LockRewind
();
}
catch
(...)
{
return
false
;
}
is
.
LockRewind
();
return
tag_id3_scan
(
is
,
handler
);
#else
...
...
@@ -49,13 +44,10 @@ ScanGenericTags(InputStream &is, TagHandler &handler) noexcept
}
bool
ScanGenericTags
(
Path
path
,
TagHandler
&
handler
)
noexcept
try
{
ScanGenericTags
(
Path
path
,
TagHandler
&
handler
)
{
Mutex
mutex
;
auto
is
=
OpenLocalInputStream
(
path
,
mutex
);
return
ScanGenericTags
(
*
is
,
handler
);
}
catch
(...)
{
LogError
(
std
::
current_exception
());
return
false
;
}
src/tag/Generic.hxx
View file @
31b59a0d
...
...
@@ -27,14 +27,18 @@ class Path;
/**
* Attempts to scan APE or ID3 tags from the specified stream. The
* stream does not need to be rewound.
*
* Throws on error.
*/
bool
ScanGenericTags
(
InputStream
&
is
,
TagHandler
&
handler
)
noexcept
;
ScanGenericTags
(
InputStream
&
is
,
TagHandler
&
handler
);
/**
* Attempts to scan APE or ID3 tags from the specified file.
*
* Throws on error.
*/
bool
ScanGenericTags
(
Path
path
,
TagHandler
&
handler
)
noexcept
;
ScanGenericTags
(
Path
path
,
TagHandler
&
handler
);
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment