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

List:       kde-commits
Subject:    extragear/multimedia/amarok
From:       Mark Kretschmann <kretschmann () kde ! org>
Date:       2009-03-17 18:33:12
Message-ID: 1237314792.892429.8124.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 940590 by markey:

Patch by Valentin Rouet <v.rouet@gmail.com>:

This patch fixes 2 problems with mp4 files tags :
1) Amarok crashed when you tried to open a mp4 file that had an empty
"composer" or "disk" tag
2) The collection scanner crashed while analysing the same kind of files

Many thanks to Valentin, and please someone test this (I don't have MP4
files).

 M  +5 -2      src/meta/file/File_p.h  
 M  +11 -4     utilities/collectionscanner/CollectionScanner.cpp  


--- trunk/extragear/multimedia/amarok/src/meta/file/File_p.h #940589:940590
@@ -267,8 +267,11 @@
         TagLib::MP4::Tag *mp4tag = dynamic_cast< TagLib::MP4::Tag *>( file->tag() );
         if( mp4tag )
         {
-            m_data.composer = strip( \
                mp4tag->itemListMap()["\xa9wrt"].toStringList().front() );
-            disc = QString::number( mp4tag->itemListMap()["disk"].toIntPair().first \
); +            if ( !mp4tag->itemListMap()["\xA9wrt"].toStringList().isEmpty() )
+                m_data.composer = strip( \
mp4tag->itemListMap()["\xA9wrt"].toStringList().front() ); +
+            if ( !mp4tag->itemListMap()["disk"].toStringList().isEmpty() )
+                disc = QString::number( \
mp4tag->itemListMap()["disk"].toIntPair().first );  }
     }
 #endif
--- trunk/extragear/multimedia/amarok/utilities/collectionscanner/CollectionScanner.cpp \
#940589:940590 @@ -802,11 +802,18 @@
             TagLib::MP4::Tag *mp4tag = dynamic_cast<TagLib::MP4::Tag *>( file->tag() \
);  if( mp4tag )
             {
-                attributes["composer"] = TStringToQString( \
                mp4tag->itemListMap()["\xa9wrt"].toStringList().front() );
-                attributes["bpm"] = QString::number( \
                mp4tag->itemListMap()["tmpo"].toInt() );
-                disc = QString::number( \
                mp4tag->itemListMap()["disk"].toIntPair().first );
-                compilation = QString::number( \
mp4tag->itemListMap()["cpil"].toBool() ? '1' : '0' ); +                if ( \
!mp4tag->itemListMap()["\xA9wrt"].toStringList().isEmpty() ) +                    \
attributes["composer"] = TStringToQString( \
mp4tag->itemListMap()["\xa9wrt"].toStringList().front() );  
+                if ( !mp4tag->itemListMap()["tmpo"].toStringList().isEmpty() )
+                    attributes["bpm"] = QString::number( \
mp4tag->itemListMap()["tmpo"].toInt() ); +
+                if ( !mp4tag->itemListMap()["disk"].toStringList().isEmpty() )
+                    disc = QString::number( \
mp4tag->itemListMap()["disk"].toIntPair().first ); +
+                if ( !mp4tag->itemListMap()["cpil"].toStringList().isEmpty() )
+                    compilation = QString::number( \
mp4tag->itemListMap()["cpil"].toBool() ? '1' : '0' ); +
 //                 if ( images && mp4tag->cover().size() )
 //                     images->push_back( EmbeddedImage( mp4tag->cover(), "" ) );
             }


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

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