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
cfa3c0ea
Commit
cfa3c0ea
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: properly handle APE's cover art
Signed-off-by:
Rafaël Carré
<
funman@videolan.org
>
parent
d9c2c020
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
modules/meta_engine/taglib.cpp
modules/meta_engine/taglib.cpp
+17
-7
No files found.
modules/meta_engine/taglib.cpp
View file @
cfa3c0ea
...
...
@@ -138,30 +138,41 @@ static void ReadMetaFromAPE( APE::Tag* tag, demux_meta_t* p_demux_meta, vlc_meta
APE
::
Item
item
;
item
=
tag
->
itemListMap
()[
"COVER ART (FRONT)"
];
if
(
!
item
.
isEmpty
()
)
if
(
!
item
.
isEmpty
()
&&
item
.
type
()
==
APE
::
Item
::
Binary
)
{
input_attachment_t
*
p_attachment
;
const
ByteVector
picture
=
item
.
value
();
const
ByteVector
picture
=
item
.
binaryData
();
const
char
*
p_data
=
picture
.
data
();
unsigned
i_data
=
picture
.
size
();
/* Null terminated filename followed by the image data */
size_t
desc_len
=
strnlen
(
p_data
,
i_data
);
if
(
desc_len
<
i_data
)
{
if
(
desc_len
<
i_data
&&
IsUTF8
(
p_data
)
)
{
const
char
*
psz_name
=
p_data
;
const
char
*
psz_mime
=
vlc_mime_Ext2Mime
(
psz_name
);
p_data
+=
desc_len
+
1
;
/* '\0' */
i_data
-=
desc_len
+
1
;
msg_Dbg
(
p_demux_meta
,
"Found embedded art: %s (%s) is %u bytes"
,
psz_name
,
"image/jpeg"
,
i_data
);
psz_name
,
psz_mime
,
i_data
);
p_attachment
=
vlc_input_attachment_New
(
"cover"
,
"image/jpeg"
,
p_attachment
=
vlc_input_attachment_New
(
psz_name
,
psz_mime
,
psz_name
,
p_data
,
i_data
);
if
(
p_attachment
)
{
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
);
}
}
}
}
...
...
@@ -1098,4 +1109,3 @@ static int WriteMeta( vlc_object_t *p_this )
return
VLC_SUCCESS
;
}
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