[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdesupport/taglib
From:       Lukáš Lalinský <lalinsky () gmail ! com>
Date:       2009-10-29 15:53:21
Message-ID: 1256831601.590595.7932.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1042312 by lalinsky:

Fixed ID3v1-style genre to string conversion in MP4 files

 M  +1 -0      NEWS  
 M  +2 -2      taglib/mp4/mp4tag.cpp  
 AM            tests/data/gnre.m4a  
 M  +7 -0      tests/test_mp4.cpp  


--- trunk/kdesupport/taglib/NEWS #1042311:1042312
@@ -10,6 +10,7 @@
  * Fixed a failing test on ppc64.
  * Support for binary 'covr' atom in MP4 files. TagLib 1.6 treated them
    as text atoms, which corrupted them in some cases.
+ * Fixed ID3v1-style genre to string conversion in MP4 files.
 
 TagLib 1.6
 ==========
--- trunk/kdesupport/taglib/taglib/mp4/mp4tag.cpp #1042311:1042312
@@ -143,8 +143,8 @@
   ByteVectorList data = parseData(atom, file);
   if(data.size()) {
     int idx = (int)data[0].toShort();
-    if(!d->items.contains("\251gen")) {
-      d->items.insert("\251gen", StringList(ID3v1::genre(idx)));
+    if(!d->items.contains("\251gen") && idx > 0) {
+      d->items.insert("\251gen", StringList(ID3v1::genre(idx - 1)));
     }
   }
 }
** trunk/kdesupport/taglib/tests/data/gnre.m4a #property svn:mime-type
   + application/octet-stream
--- trunk/kdesupport/taglib/tests/test_mp4.cpp #1042311:1042312
@@ -19,6 +19,7 @@
   CPPUNIT_TEST(testUpdateStco);
   CPPUNIT_TEST(testSaveExisingWhenIlstIsLast);
   CPPUNIT_TEST(test64BitAtom);
+  CPPUNIT_TEST(testGnre);
   CPPUNIT_TEST(testCovrRead);
   CPPUNIT_TEST(testCovrWrite);
   CPPUNIT_TEST_SUITE_END();
@@ -147,6 +148,12 @@
     deleteFile(filename);
   }
 
+  void testGnre()
+  {
+    MP4::File *f = new MP4::File("data/gnre.m4a");
+    CPPUNIT_ASSERT_EQUAL(TagLib::String("Ska"), f->tag()->genre());
+  }
+
   void testCovrRead()
   {
     MP4::File *f = new MP4::File("data/has-tags.m4a");
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic