]> git.sesse.net Git - kdenlive/blobdiff - src/clipmanager.cpp
Fix crash on audio thumbs for playlists:http://kdenlive.org/mantis/view.php?id=2911
[kdenlive] / src / clipmanager.cpp
index 8eea860b1c9135bf09fbf2550b6119faba421e9c..83e348490129ff16e46672b9fda7c5d0eb3628fd 100644 (file)
@@ -264,12 +264,14 @@ void ClipManager::slotGetAudioThumbs()
         if (hash.isEmpty()) continue;
         QString audioPath = projectFolder() + "/thumbs/" + hash + ".thumb";
         double lengthInFrames = clip->duration().frames(m_doc->fps());
-       int frequency = 48000;
-       int channels = 2;
+       int frequency = 0;
+       int channels = 0;
        QString data = clip->getProperty("frequency");
        if (!data.isEmpty()) frequency = data.toInt();
+       if (frequency <= 0) frequency = 48000;
        data = clip->getProperty("channels");
        if (!data.isEmpty()) channels = data.toInt();
+       if (channels <= 0) channels = 2;
        int arrayWidth = 20;
         double frame = 0.0;
        int maxVolume = 0;