From: Jean-Baptiste M. <jb...@kd...> - 2012-12-29 16:33:08
|
Git commit e384cfce0d3eb8847687326c85d8e621e14b8184 by Jean-Baptiste Mardelle. Committed on 29/12/2012 at 17:32. Pushed by mardelle into branch 'master'. Fix crash on audio thumbs for playlists:http://kdenlive.org/mantis/view.php?id=2911 M +4 -2 src/clipmanager.cpp M +2 -2 src/renderer.cpp http://commits.kde.org/kdenlive/e384cfce0d3eb8847687326c85d8e621e14b8184 diff --git a/src/clipmanager.cpp b/src/clipmanager.cpp index 8eea860..83e3484 100644 --- a/src/clipmanager.cpp +++ b/src/clipmanager.cpp @@ -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; diff --git a/src/renderer.cpp b/src/renderer.cpp index 6ba456f..ca7f0d8 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp @@ -990,8 +990,8 @@ void Render::processFileProperties() // keep for compatibility with MLT <= 0.8.6 if (af == 0) af = frame->get_int("frequency"); if (ac == 0) ac = frame->get_int("channels"); - filePropertyMap["frequency"] = QString::number(af); - filePropertyMap["channels"] = QString::number(ac); + if (af > 0) filePropertyMap["frequency"] = QString::number(af); + if (ac > 0) filePropertyMap["channels"] = QString::number(ac); if (!filePropertyMap.contains("aspect_ratio")) filePropertyMap["aspect_ratio"] = frame->get("aspect_ratio"); if (frame->get_int("test_image") == 0) { |