]> git.sesse.net Git - vlc/blobdiff - modules/meta_engine/taglib.cpp
Ehm, this is 0.9.0-test2, not 0.8.6i *coughcough*
[vlc] / modules / meta_engine / taglib.cpp
index 8cd05e8fe4ce2120cbe011204a419148efca7f00..67e54dd7e3ac4c37846e72e1ffa853a6fc192517 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_plugin.h>
 #include <vlc_playlist.h>
 #include <vlc_meta.h>
 #include <vlc_demux.h>
@@ -119,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",
-                    f.file()->name() );
+                    "%s: Invalid picture embedded by broken iTunes version, "
+                    "you really shouldn't use this crappy software.",
+                    (const char *)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();