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
ae6bd9c8
Commit
ae6bd9c8
authored
Jan 22, 2009
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
taglib: fix empty attachement urls and if try others embeded image if one isn't good.
parent
ff690fdb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
+20
-4
modules/meta_engine/taglib.cpp
modules/meta_engine/taglib.cpp
+20
-4
No files found.
modules/meta_engine/taglib.cpp
View file @
ae6bd9c8
...
...
@@ -194,6 +194,7 @@ static void ReadMetaFromId3v2( ID3v2::Tag* tag, demux_t* p_demux, demux_meta_t*
list
=
tag
->
frameListMap
()[
"APIC"
];
if
(
list
.
isEmpty
()
)
return
;
TAB_INIT
(
p_demux_meta
->
i_attachments
,
p_demux_meta
->
attachments
);
for
(
ID3v2
::
FrameList
::
Iterator
iter
=
list
.
begin
();
iter
!=
list
.
end
();
iter
++
)
...
...
@@ -202,11 +203,24 @@ static void ReadMetaFromId3v2( ID3v2::Tag* tag, demux_t* p_demux, demux_meta_t*
dynamic_cast
<
ID3v2
::
AttachedPictureFrame
*>
(
*
iter
);
input_attachment_t
*
p_attachment
;
const
char
*
psz_
name
,
*
psz_mime
,
*
psz_description
;
const
char
*
psz_
mime
;
const
char
*
p_data
;
int
i_data
;
char
*
psz_name
,
*
psz_description
;
// Get the mime and description of the image.
// If the description is empty, take the type as a description
psz_mime
=
p_apic
->
mimeType
().
toCString
(
true
);
psz_description
=
psz_name
=
p_apic
->
description
().
toCString
(
true
);
if
(
p_apic
->
description
().
size
()
>
0
)
psz_description
=
strdup
(
p_apic
->
description
().
toCString
(
true
)
);
else
{
if
(
asprintf
(
&
psz_description
,
"%i"
,
p_apic
->
type
()
)
==
-
1
)
psz_description
=
NULL
;
}
if
(
!
psz_description
)
continue
;
psz_name
=
psz_description
;
/* some old iTunes version not only sets incorrectly the mime type
* or the description of the image,
...
...
@@ -216,7 +230,8 @@ static void ReadMetaFromId3v2( ID3v2::Tag* tag, demux_t* p_demux, demux_meta_t*
!
strncmp
(
psz_name
,
"
\xC2\x89
PNG"
,
5
)
)
{
msg_Warn
(
p_demux
,
"Invalid picture embedded by broken iTunes version"
);
break
;
free
(
psz_description
);
continue
;
}
p_data
=
p_apic
->
picture
().
data
();
...
...
@@ -230,6 +245,7 @@ static void ReadMetaFromId3v2( ID3v2::Tag* tag, demux_t* p_demux, demux_meta_t*
TAB_APPEND_CAST
(
(
input_attachment_t
**
),
p_demux_meta
->
i_attachments
,
p_demux_meta
->
attachments
,
p_attachment
);
free
(
psz_description
);
if
(
pi_cover_score
[
p_apic
->
type
()]
>
i_score
)
{
...
...
@@ -237,7 +253,7 @@ static void ReadMetaFromId3v2( ID3v2::Tag* tag, demux_t* p_demux, demux_meta_t*
char
*
psz_url
;
if
(
asprintf
(
&
psz_url
,
"attachment://%s"
,
p_attachment
->
psz_name
)
==
-
1
)
break
;
continue
;
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