diff data/fileio/OggVorbisFileReader.cpp @ 633:7feec7756b41

* Bit more work on track composer identification
author Chris Cannam
date Mon, 22 Mar 2010 16:41:01 +0000
parents 3e139b2dfe5e
children 773fc0e43feb
line wrap: on
line diff
--- a/data/fileio/OggVorbisFileReader.cpp	Fri Mar 19 12:21:59 2010 +0000
+++ b/data/fileio/OggVorbisFileReader.cpp	Mon Mar 22 16:41:01 2010 +0000
@@ -171,19 +171,20 @@
     OggVorbisFileReader *reader = (OggVorbisFileReader *)data;
 
     if (!reader->m_commentsRead) {
-        {
-            const FishSoundComment *comment = fish_sound_comment_first_byname
-                (fs, "TITLE");
-            if (comment && comment->value) {
-                reader->m_title = QString::fromUtf8(comment->value);
-            }
+        const FishSoundComment *comment;
+        comment = fish_sound_comment_first_byname(fs, "TITLE");
+        if (comment && comment->value) {
+            reader->m_title = QString::fromUtf8(comment->value);
         }
-        {
-            const FishSoundComment *comment = fish_sound_comment_first_byname
-                (fs, "ARTIST");
-            if (comment && comment->value) {
-                reader->m_maker = QString::fromUtf8(comment->value);
-            }
+        comment = fish_sound_comment_first_byname(fs, "ARTIST");
+        if (comment && comment->value) {
+            reader->m_maker = QString::fromUtf8(comment->value);
+        }
+        comment = fish_sound_comment_first(fs);
+        while (comment) {
+            reader->m_tags[QString::fromUtf8(comment->name)] =
+                QString::fromUtf8(comment->value);
+            comment = fish_sound_comment_next(fs, comment);
         }
         reader->m_commentsRead = true;
     }