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
3d9652ae
Commit
3d9652ae
authored
Feb 26, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TagStream: add TagBuilder overload with ScanGenericTags() fallback
This commit adds support for APE/ID3 tags from NFS/SMB files. See
http://bugs.musicpd.org/view.php?id=4270
parent
a9130cb9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
4 deletions
+46
-4
NEWS
NEWS
+1
-0
SongUpdate.cxx
src/SongUpdate.cxx
+2
-4
TagStream.cxx
src/TagStream.cxx
+28
-0
TagStream.hxx
src/TagStream.hxx
+15
-0
No files found.
NEWS
View file @
3d9652ae
...
...
@@ -14,6 +14,7 @@ ver 0.20 (not yet released)
- id3: remove the "id3v1_encoding" setting; by definition, all ID3v1 tags
are ISO-Latin-1
- ape: support APE replay gain on remote files
- read ID3 tags from NFS/SMB
* decoder
- improved error logging
- report I/O errors to clients
...
...
src/SongUpdate.cxx
View file @
3d9652ae
...
...
@@ -92,8 +92,7 @@ Song::UpdateFile(Storage &storage)
if
(
path_fs
.
IsNull
())
{
const
auto
absolute_uri
=
storage
.
MapUTF8
(
relative_uri
.
c_str
());
if
(
!
tag_stream_scan
(
absolute_uri
.
c_str
(),
full_tag_handler
,
&
tag_builder
))
if
(
!
tag_stream_scan
(
absolute_uri
.
c_str
(),
tag_builder
))
return
false
;
}
else
{
if
(
!
tag_file_scan
(
path_fs
,
tag_builder
))
...
...
@@ -165,8 +164,7 @@ DetachedSong::Update()
return
LoadFile
(
path_fs
);
}
else
if
(
IsRemote
())
{
TagBuilder
tag_builder
;
if
(
!
tag_stream_scan
(
uri
.
c_str
(),
full_tag_handler
,
&
tag_builder
))
if
(
!
tag_stream_scan
(
uri
.
c_str
(),
tag_builder
))
return
false
;
mtime
=
0
;
...
...
src/TagStream.cxx
View file @
3d9652ae
...
...
@@ -19,6 +19,9 @@
#include "config.h"
#include "TagStream.hxx"
#include "tag/Generic.hxx"
#include "tag/TagHandler.hxx"
#include "tag/TagBuilder.hxx"
#include "util/UriUtil.hxx"
#include "util/Error.hxx"
#include "decoder/DecoderList.hxx"
...
...
@@ -72,3 +75,28 @@ tag_stream_scan(const char *uri, const TagHandler &handler, void *ctx)
IgnoreError
());
return
is
&&
tag_stream_scan
(
*
is
,
handler
,
ctx
);
}
bool
tag_stream_scan
(
InputStream
&
is
,
TagBuilder
&
builder
)
{
assert
(
is
.
IsReady
());
if
(
!
tag_stream_scan
(
is
,
full_tag_handler
,
&
builder
))
return
false
;
if
(
builder
.
IsEmpty
())
ScanGenericTags
(
is
,
full_tag_handler
,
&
builder
);
return
true
;
}
bool
tag_stream_scan
(
const
char
*
uri
,
TagBuilder
&
builder
)
{
Mutex
mutex
;
Cond
cond
;
auto
is
=
InputStream
::
OpenReady
(
uri
,
mutex
,
cond
,
IgnoreError
());
return
is
&&
tag_stream_scan
(
*
is
,
builder
);
}
src/TagStream.hxx
View file @
3d9652ae
...
...
@@ -24,6 +24,7 @@
class
InputStream
;
struct
TagHandler
;
class
TagBuilder
;
/**
* Scan the tags of an #InputStream. Invokes matching decoder
...
...
@@ -38,4 +39,18 @@ tag_stream_scan(InputStream &is, const TagHandler &handler, void *ctx);
bool
tag_stream_scan
(
const
char
*
uri
,
const
TagHandler
&
handler
,
void
*
ctx
);
/**
* Scan the tags of an #InputStream. Invokes matching decoder
* plugins, and falls back to generic scanners (APE and ID3) if no
* tags were found (but the file was recognized).
*
* @return true if the file was recognized (even if no metadata was
* found)
*/
bool
tag_stream_scan
(
InputStream
&
is
,
TagBuilder
&
builder
);
bool
tag_stream_scan
(
const
char
*
uri
,
TagBuilder
&
builder
);
#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