[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-11-02 19:41:12
Message-ID: 1257190872.996081.24736.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1043985 by lalinsky:

Always read tags from the first Vorbis Comment block in FLAC files

Prevously TagLib saved tags to the first block, but read them from the
last one. Having multiple VC blocks is a non-standard situation, but
this is the best we can do (libFLAC also uses the first block in the
case of multiple VC blocks). 

BUG:211089


 M  +7 -3      taglib/flac/flacfile.cpp  
 M  +1 -0      tests/CMakeLists.txt  
 AM            tests/data/multiple-vc.flac  
 AM            tests/test_flac.cpp   [License: UNKNOWN]


--- trunk/kdesupport/taglib/taglib/flac/flacfile.cpp #1043984:1043985
@@ -406,7 +406,6 @@
   nextBlockOffset += length + 4;
 
   // Search through the remaining metadata
-
   while(!isLastBlock) {
 
     header = readBlock(4);
@@ -416,8 +415,13 @@
 
     // Found the vorbis-comment
     if(blockType == VorbisComment) {
-      d->xiphCommentData = readBlock(length);
-      d->hasXiphComment = true;
+      if(!d->hasXiphComment) {
+        d->xiphCommentData = readBlock(length);
+        d->hasXiphComment = true;
+      }
+      else {
+        debug("FLAC::File::scan() -- multiple Vorbis Comment blocks found, using the first one");
+      }
     }
 
     nextBlockOffset += length + 4;
--- trunk/kdesupport/taglib/tests/CMakeLists.txt #1043984:1043985
@@ -36,6 +36,7 @@
   test_riff.cpp
   test_ogg.cpp
   test_oggflac.cpp
+  test_flac.cpp
 )
 IF(WITH_MP4)
    SET(test_runner_SRCS ${test_runner_SRCS}
** trunk/kdesupport/taglib/tests/data/multiple-vc.flac #property svn:mime-type
   + application/octet-stream
** trunk/kdesupport/taglib/tests/test_flac.cpp #property svn:eol-style
   + native
[prev in list] [next in list] [prev in thread] [next in thread] 

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