]> git.sesse.net Git - kdenlive/blobdiff - src/clipitem.cpp
Make sure we only use one thread to create video thumbnails
[kdenlive] / src / clipitem.cpp
index 5f4cfb0269eb8030e05426f805f1de2a43d0c8de..9f6f04209f962c5c530e1019b16f2c42b75f7bcb 100644 (file)
@@ -517,7 +517,6 @@ void ClipItem::resetThumbs(bool clearExistingThumbs)
         m_endPix = QPixmap();
         m_audioThumbCachePic.clear();
     }
-    //kDebug()<<"...........  RESET THMBS: "<<clearExistingThumbs;
     slotFetchThumbs();
 }
 
@@ -563,30 +562,30 @@ void ClipItem::slotFetchThumbs()
         return;
     }
 
-    if (m_endPix.isNull() && m_startPix.isNull()) {
+    QList <int> frames;
+    if (m_startPix.isNull()) {
         m_startThumbRequested = true;
+        frames.append((int)m_speedIndependantInfo.cropStart.frames(m_fps));
+    }
+
+    if (m_endPix.isNull()) {
         m_endThumbRequested = true;
-        m_clip->slotExtractImage((int)m_speedIndependantInfo.cropStart.frames(m_fps), (int)(m_speedIndependantInfo.cropStart + m_speedIndependantInfo.cropDuration).frames(m_fps) - 1);
-    } else {
-        if (m_endPix.isNull()) {
-            slotGetEndThumb();
-        }
-        if (m_startPix.isNull()) {
-            slotGetStartThumb();
-        }
+        frames.append((int)(m_speedIndependantInfo.cropStart + m_speedIndependantInfo.cropDuration).frames(m_fps) - 1);
     }
+
+    m_clip->slotExtractImage(frames);
 }
 
 void ClipItem::slotGetStartThumb()
 {
     m_startThumbRequested = true;
-    m_clip->slotExtractImage((int)m_speedIndependantInfo.cropStart.frames(m_fps), -1);
+    m_clip->slotExtractImage(QList<int>() << (int)m_speedIndependantInfo.cropStart.frames(m_fps));
 }
 
 void ClipItem::slotGetEndThumb()
 {
     m_endThumbRequested = true;
-    m_clip->slotExtractImage(-1, (int)(m_speedIndependantInfo.cropStart + m_speedIndependantInfo.cropDuration).frames(m_fps) - 1);
+    m_clip->slotExtractImage(QList<int>() << (int)(m_speedIndependantInfo.cropStart + m_speedIndependantInfo.cropDuration).frames(m_fps) - 1);
 }