[vlc-devel] commit: Workaround f*cked up iTunes ( Rafaël Carré )

git version control git at videolan.org
Thu May 22 20:23:39 CEST 2008


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Thu May 22 20:24:36 2008 +0200| [eef284f3b6e266ffc7f82a2f447f74d5813afbc1]

Workaround f*cked up iTunes

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=eef284f3b6e266ffc7f82a2f447f74d5813afbc1
---

 modules/meta_engine/taglib.cpp |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp
index c1ba0f2..810fd3f 100644
--- a/modules/meta_engine/taglib.cpp
+++ b/modules/meta_engine/taglib.cpp
@@ -124,21 +124,22 @@ static void DetectImage( FileRef f, demux_t *p_demux )
             ByteVector p_data_taglib; const char *p_data; int i_data;
 
             psz_mime = p_apic->mimeType().toCString(true);
+            psz_description = psz_name = p_apic->description().toCString(true);
 
             /* some old iTunes version not only sets incorrectly the mime type
+             * or the description of the image,
              * but also embeds incorrectly the image.
              * Recent versions seem to behave correctly */
-            if( !strncmp( psz_mime, "PNG", 3 ) )
+            if( !strncmp( psz_mime, "PNG", 3 ) ||
+                !strncmp( psz_name, "\xC2\x89PNG", 5 ) )
             {
                 msg_Warn( p_demux,
-                    "%s: Invalid picture embedded by broken iTunes version",
+                    "%s: Invalid picture embedded by broken iTunes version, "
+                    "you really shouldn't use this crappy software.",
                     f.file()->name() );
                 break;
             }
 
-            psz_description = p_apic->description().toCString(true);
-            psz_name = psz_description;
-
             p_data_taglib = p_apic->picture();
             p_data = p_data_taglib.data();
             i_data = p_data_taglib.size();




More information about the vlc-devel mailing list