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
889cc775
Commit
889cc775
authored
Apr 10, 2012
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Taglib: correctly read pictures in Xiph files
Those that use METADATA_PICTURE_BLOCK
parent
80b1c2b4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
19 deletions
+36
-19
modules/meta_engine/taglib.cpp
modules/meta_engine/taglib.cpp
+36
-19
No files found.
modules/meta_engine/taglib.cpp
View file @
889cc775
...
...
@@ -67,6 +67,7 @@
#include <mpegfile.h>
#include <oggfile.h>
#include <oggflacfile.h>
#include "../demux/vorbis.h"
#if TAGLIB_VERSION >= VERSION_INT(1,6,0)
# define TAGLIB_HAVE_AIFF_WAV_H
...
...
@@ -365,14 +366,14 @@ static void ReadMetaFromXiph( Ogg::XiphComment* tag, demux_meta_t* p_demux_meta,
StringList
mime_list
=
tag
->
fieldListMap
()[
"COVERARTMIME"
];
StringList
art_list
=
tag
->
fieldListMap
()[
"COVERART"
];
input_attachment_t
*
p_attachment
;
if
(
mime_list
.
size
()
!=
0
&&
art_list
.
size
()
!=
0
)
{
// We get only the first covert art
if
(
mime_list
.
size
()
>
1
||
art_list
.
size
()
>
1
)
msg_Warn
(
p_demux_meta
,
"Found %i embedded arts, so using only the first one"
,
art_list
.
size
()
);
else
if
(
mime_list
.
size
()
==
0
||
art_list
.
size
()
==
0
)
return
;
input_attachment_t
*
p_attachment
;
const
char
*
psz_name
=
"cover"
;
const
char
*
psz_mime
=
mime_list
[
0
].
toCString
(
true
);
...
...
@@ -384,16 +385,32 @@ static void ReadMetaFromXiph( Ogg::XiphComment* tag, demux_meta_t* p_demux_meta,
msg_Dbg
(
p_demux_meta
,
"Found embedded art: %s (%s) is %i bytes"
,
psz_name
,
psz_mime
,
i_data
);
TAB_INIT
(
p_demux_meta
->
i_attachments
,
p_demux_meta
->
attachments
);
p_attachment
=
vlc_input_attachment_New
(
psz_name
,
psz_mime
,
psz_description
,
p_data
,
i_data
);
free
(
p_data
);
}
else
{
art_list
=
tag
->
fieldListMap
()[
"METADATA_BLOCK_PICTURE"
];
if
(
art_list
.
size
()
==
0
)
return
;
uint8_t
*
p_data
;
int
type
;
int
i_data
=
vlc_b64_decode_binary
(
&
p_data
,
art_list
[
0
].
toCString
(
true
)
);
p_attachment
=
ParseFlacPicture
(
p_data
,
i_data
,
0
,
&
type
);
}
TAB_INIT
(
p_demux_meta
->
i_attachments
,
p_demux_meta
->
attachments
);
TAB_APPEND_CAST
(
(
input_attachment_t
**
),
p_demux_meta
->
i_attachments
,
p_demux_meta
->
attachments
,
p_attachment
);
vlc_meta_SetArtURL
(
p_meta
,
"attachment://cover"
);
char
*
psz_url
;
if
(
asprintf
(
&
psz_url
,
"attachment://%s"
,
p_attachment
->
psz_name
)
!=
-
1
)
{
vlc_meta_SetArtURL
(
p_meta
,
psz_url
);
free
(
psz_url
);
}
}
...
...
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