]> git.sesse.net Git - kdenlive/commitdiff
* don't crash when clip is missing
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 12 May 2008 18:29:28 +0000 (18:29 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 12 May 2008 18:29:28 +0000 (18:29 +0000)
* disabling audio thumbs should stop running processes

svn path=/branches/KDE4/; revision=2186

src/docclipbase.cpp

index 7532f0f9399d9173eb7127ecaf287e992df6fc93..d0ac46166d4869e58283856edd1ea52b648c1016 100644 (file)
@@ -42,7 +42,7 @@ DocClipBase::DocClipBase(ClipManager *clipManager, QDomElement xml, uint id):
     }
     if (m_name.isEmpty()) m_name = url.fileName();
 
-    if (!url.isEmpty()) {
+    if (!url.isEmpty() && QFile::exists(url.path())) {
         m_thumbProd = new KThumb(clipManager, url);
         if (m_clipType == AV || m_clipType == AUDIO) slotCreateAudioTimer();
     }
@@ -87,6 +87,8 @@ void DocClipBase::slotRequestAudioThumbs() {
 }
 
 void DocClipBase::slotClearAudioCache() {
+    if (m_thumbProd) m_thumbProd->stopAudioThumbs();
+    if (m_audioTimer != NULL) m_audioTimer->stop();
     audioFrameChache.clear();
     m_audioThumbCreated = false;
 }
@@ -122,7 +124,7 @@ const CLIPTYPE & DocClipBase::clipType() const {
 
 void DocClipBase::setClipType(CLIPTYPE type) {
     m_clipType = type;
-    if (m_audioTimer == NULL && (m_clipType == AV || m_clipType == AUDIO))
+    if (m_thumbProd && m_audioTimer == NULL && (m_clipType == AV || m_clipType == AUDIO))
         slotCreateAudioTimer();
 }
 
@@ -390,7 +392,7 @@ QMap <QString, QString> DocClipBase::properties() const {
 }
 
 void DocClipBase::slotGetAudioThumbs() {
-
+    if (m_thumbProd == NULL) return;
     if (m_audioThumbCreated) {
         if (m_audioTimer != NULL)
             m_audioTimer->stop();