Commits

shuerhaaken committed 6a175d4

add fallback to mp4

  • Participants
  • Parent commits 63a40b1

Comments (0)

Files changed (4)

+commit 63a40b166a1a0805305f00601693d4fbc9cbcb77
+Author: Jörn Magens <shuerhaaken@googlemail.com>
+Date:   Thu Apr 4 18:20:38 2013 +0200
+
+    remove old code
+
 commit cd977442ab08614aff182356e665d16b300d5997
 Author: Jörn Magens <shuerhaaken@googlemail.com>
 Date:   Thu Apr 4 18:17:15 2013 +0200
     packaging \
     tests
 
-dist_noinst_DATA = AUTHORS COPYING NEWS TODO README ChangeLog
+dist_noinst_DATA = AUTHORS COPYING NEWS TODO README ChangeLog taginfo.svg
 dist_noinst_SCRIPTS = autogen.sh
 
 DISTCLEANFILES = \

libtaginfo/mp4info.cc

     if(taglib_file) {
         mp4_tag = ((TagLib::MP4::File *) taglib_file)->tag();
         if(!mp4_tag || mp4_tag->isEmpty()) { // Use fallback for id3v1 or extended header
+            if(!mp4_tag)
+                printf("Mp4tag null for %s\n", filename.toCString(false));
             //printf("Use fallback! %s\n", filename.c_str());
-            taglib_tag = ((TagLib::MP4::File *) taglib_file)->tag();
+            if(!taglib_tag)
+                taglib_tag = taglib_file->tag();
+            if(!taglib_tag) {
+                taglib_fileref = new TagLib::FileRef(filename.toCString(false),
+                                                     true, TagLib::AudioProperties::Fast);
+                taglib_tag = taglib_fileref->tag();
+            }
             if(!taglib_tag) {
                 printf("Cant get tag object from '%s'\n", file_name.toCString(false));
                 valid = false;
         }
     }
     else {
-        printf("Cant get tag from '%s'\n", file_name.toCString(false));
+        printf("2Cant get tag from '%s'\n", file_name.toCString(false));
         mp4_tag = NULL;
         valid = false;
     }

tests/samples/Makefile.am

     sample.ogg \
     sample.tta \
     sample.wav \
+    sample.wv \
     sample.wma
 
 EXTRA_DIST = \