[vlc-devel] commit: taglib: accept the Xiph comments with more than one embedded art, ( Rémi Duraffort )
git version control
git at videolan.org
Sat Jan 10 22:06:35 CET 2009
vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sat Jan 10 19:11:58 2009 +0100| [ef1af103ab5ec6c647b3339b97c1dd2d73d69d6a] | committer: Rémi Duraffort
taglib: accept the Xiph comments with more than one embedded art,
but take only the first one.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ef1af103ab5ec6c647b3339b97c1dd2d73d69d6a
---
modules/meta_engine/taglib.cpp | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp
index df2a7bb..2aa740b 100644
--- a/modules/meta_engine/taglib.cpp
+++ b/modules/meta_engine/taglib.cpp
@@ -270,21 +270,21 @@ static void ReadMetaFromXiph( Ogg::XiphComment* tag, demux_t* p_demux, demux_met
StringList mime_list = tag->fieldListMap()[ "COVERARTMIME" ];
StringList art_list = tag->fieldListMap()[ "COVERART" ];
- /* we support only one cover in ogg/vorbis */
- if( mime_list.size() != 1 || art_list.size() != 1 )
+ // We get only the first covert art
+ if( mime_list.size() > 1 || art_list.size() > 1 )
+ msg_Warn( p_demux, "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, *psz_mime, *psz_description;
- uint8_t *p_data;
- int i_data;
-
- psz_name = "cover";
- psz_mime = mime_list[0].toCString(true);
- psz_description = "cover";
+ const char* psz_name = "cover";
+ const char* psz_mime = mime_list[0].toCString(true);
+ const char* psz_description = "cover";
- i_data = vlc_b64_decode_binary( &p_data, art_list[0].toCString(true) );
+ uint8_t *p_data;
+ int i_data = vlc_b64_decode_binary( &p_data, art_list[0].toCString(true) );
msg_Dbg( p_demux, "Found embedded art: %s (%s) is %i bytes",
psz_name, psz_mime, i_data );
More information about the vlc-devel
mailing list