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
92f74217
Commit
92f74217
authored
May 21, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TagFile: allow ScanFileTags*() to throw
parent
6f1d5105
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
15 deletions
+12
-15
TagFile.cxx
src/TagFile.cxx
+6
-13
TagFile.hxx
src/TagFile.hxx
+6
-2
No files found.
src/TagFile.cxx
View file @
92f74217
...
...
@@ -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
);
...
...
src/TagFile.hxx
View file @
92f74217
...
...
@@ -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 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 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
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