Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
17fa368e
Commit
17fa368e
authored
May 25, 2010
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
taglib: read the cover art from mp4.
parent
0b01c67e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
1 deletion
+30
-1
modules/meta_engine/taglib.cpp
modules/meta_engine/taglib.cpp
+30
-1
No files found.
modules/meta_engine/taglib.cpp
View file @
17fa368e
...
...
@@ -63,6 +63,10 @@
# include <wavfile.h>
#endif
#ifdef TAGLIB_WITH_MP4
# include <mp4file.h>
#endif
#include <speexfile.h>
#include <trueaudiofile.h>
#include <vorbisfile.h>
...
...
@@ -317,7 +321,25 @@ static void ReadMetaFromXiph( Ogg::XiphComment* tag, demux_t* p_demux, demux_met
vlc_meta_SetArtURL
(
p_meta
,
"attachment://cover"
);
}
#ifdef TAGLIB_WITH_MP4
static
void
ReadMetaFromMP4
(
MP4
::
Tag
*
tag
,
demux_t
*
p_demux
,
demux_meta_t
*
p_demux_meta
,
vlc_meta_t
*
p_meta
)
{
if
(
tag
->
itemListMap
().
contains
(
"covr"
)
)
{
MP4
::
CoverArtList
list
=
tag
->
itemListMap
()[
"covr"
].
toCoverArtList
();
const
char
*
psz_format
=
list
[
0
].
format
()
==
MP4
::
CoverArt
::
PNG
?
"image/png"
:
"image/jpeg"
;
TAB_INIT
(
p_demux_meta
->
i_attachments
,
p_demux_meta
->
attachments
);
input_attachment_t
*
p_attachment
=
vlc_input_attachment_New
(
"cover"
,
psz_format
,
"cover"
,
list
[
0
].
data
().
data
(),
list
[
0
].
data
().
size
()
);
TAB_APPEND_CAST
(
(
input_attachment_t
**
),
p_demux_meta
->
i_attachments
,
p_demux_meta
->
attachments
,
p_attachment
);
vlc_meta_SetArtURL
(
p_meta
,
"attachment://cover"
);
}
}
#endif
/**
* Get the tags from the file using TagLib
...
...
@@ -398,6 +420,13 @@ static int ReadMeta( vlc_object_t* p_this)
else
if
(
flac
->
xiphComment
()
)
ReadMetaFromXiph
(
flac
->
xiphComment
(),
p_demux
,
p_demux_meta
,
p_meta
);
}
#ifdef TAGLIB_WITH_MP4
else
if
(
MP4
::
File
*
mp4
=
dynamic_cast
<
MP4
::
File
*>
(
f
.
file
())
)
{
if
(
mp4
->
tag
()
)
ReadMetaFromMP4
(
mp4
->
tag
(),
p_demux
,
p_demux_meta
,
p_meta
);
}
#endif
else
if
(
MPC
::
File
*
mpc
=
dynamic_cast
<
MPC
::
File
*>
(
f
.
file
())
)
{
if
(
mpc
->
APETag
()
)
...
...
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