Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
b28313ac
Commit
b28313ac
authored
Jul 24, 2014
by
Anatoliy Anischovich
Committed by
Rafaël Carré
Jul 24, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
taglib: use iterator-based approach for APE's tag processing
Signed-off-by:
Rafaël Carré
<
funman@videolan.org
>
parent
cfa3c0ea
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
11 deletions
+37
-11
modules/meta_engine/taglib.cpp
modules/meta_engine/taglib.cpp
+37
-11
No files found.
modules/meta_engine/taglib.cpp
View file @
b28313ac
...
...
@@ -135,14 +135,17 @@ static void ExtractTrackNumberValues( vlc_meta_t* p_meta, const char *psz_value
*/
static
void
ReadMetaFromAPE
(
APE
::
Tag
*
tag
,
demux_meta_t
*
p_demux_meta
,
vlc_meta_t
*
p_meta
)
{
APE
::
Item
item
;
APE
::
ItemListMap
fields
(
tag
->
itemListMap
()
);
APE
::
ItemListMap
::
Iterator
iter
;
item
=
tag
->
itemListMap
()[
"COVER ART (FRONT)"
];
if
(
!
item
.
isEmpty
()
&&
item
.
type
()
==
APE
::
Item
::
Binary
)
iter
=
fields
.
find
(
"COVER ART (FRONT)"
);
if
(
iter
!=
fields
.
end
()
&&
!
iter
->
second
.
isEmpty
()
&&
!
iter
->
second
.
type
()
==
APE
::
Item
::
Binary
)
{
input_attachment_t
*
p_attachment
;
const
ByteVector
picture
=
ite
m
.
binaryData
();
const
ByteVector
picture
=
ite
r
->
second
.
binaryData
();
const
char
*
p_data
=
picture
.
data
();
unsigned
i_data
=
picture
.
size
();
...
...
@@ -174,15 +177,23 @@ static void ReadMetaFromAPE( APE::Tag* tag, demux_meta_t* p_demux_meta, vlc_meta
}
}
}
fields
.
erase
(
iter
);
}
#define SET( keyName, metaName ) \
item = tag->itemListMap()[keyName]; \
if( !item.isEmpty() ) vlc_meta_Set##metaName( p_meta, item.toString().toCString( true ) );
iter = fields.find(keyName); \
if( iter != fields.end() && !iter->second.isEmpty() ) { \
vlc_meta_Set##metaName( p_meta, iter->second.toString().toCString( true ) ); \
fields.erase(iter); \
}
#define SET_EXTRA( keyName, metaName ) \
item = tag->itemListMap()[keyName]; \
if( !item.isEmpty() ) vlc_meta_AddExtra( p_meta, metaName, item.toString().toCString( true ) );
iter = fields.find( keyName ); \
if( iter != fields.end() && !iter->second.isEmpty() ) { \
vlc_meta_AddExtra( p_meta, metaName, iter->second.toString().toCString( true ) ); \
fields.erase(iter); \
}
SET
(
"ALBUM"
,
Album
);
SET
(
"ARTIST"
,
Artist
);
...
...
@@ -200,10 +211,25 @@ static void ReadMetaFromAPE( APE::Tag* tag, demux_meta_t* p_demux_meta, vlc_meta
#undef SET_EXTRA
/* */
item
=
tag
->
itemListMap
()[
"TRACK"
];
if
(
!
item
.
isEmpty
()
)
iter
=
fields
.
find
(
"TRACK"
);
if
(
iter
!=
fields
.
end
()
&&
!
iter
->
second
.
isEmpty
()
)
{
ExtractTrackNumberValues
(
p_meta
,
iter
->
second
.
toString
().
toCString
(
true
)
);
fields
.
erase
(
iter
);
}
/* Remainings */
for
(
iter
=
fields
.
begin
();
iter
!=
fields
.
end
();
++
iter
)
{
ExtractTrackNumberValues
(
p_meta
,
item
.
toString
().
toCString
(
true
)
);
if
(
iter
->
second
.
isEmpty
()
)
continue
;
if
(
iter
->
second
.
type
()
!=
APE
::
Item
::
Text
)
continue
;
vlc_meta_AddExtra
(
p_meta
,
iter
->
first
.
toCString
(
true
),
iter
->
second
.
toString
().
toCString
(
true
)
);
}
}
...
...
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