]> git.sesse.net Git - kdenlive/blobdiff - src/kthumb.cpp
Fix forcing some clip properties not always working correctly
[kdenlive] / src / kthumb.cpp
index 66cdad249224e5645b9bee69fbf85c481399d0e8..2c8ac9b7cfbe628d00b6088334e9e089ec456d5d 100644 (file)
@@ -108,13 +108,13 @@ QPixmap KThumb::getImage(KUrl url, int width, int height)
 void KThumb::extractImage(QList <int>frames)
 {
     if (!KdenliveSettings::videothumbnails() || m_producer == NULL) return;
-    m_clipManager->requestThumbs(m_id, frames);
+    m_clipManager->slotRequestThumbs(m_id, frames);
 }
 
 
 void KThumb::getThumb(int frame)
 {
-    const int theight = KdenliveSettings::trackheight();
+    const int theight = Kdenlive::DefaultThumbHeight;
     const int swidth = (int)(theight * m_ratio + 0.5);
     const int dwidth = (int)(theight * m_dar + 0.5);
     QImage img = getProducerFrame(frame, swidth, dwidth, theight);
@@ -168,6 +168,9 @@ QImage KThumb::getProducerFrame(int framepos, int frameWidth, int displayWidth,
     QMutexLocker lock(&m_mutex);
     m_producer->seek(framepos);
     Mlt::Frame *frame = m_producer->get_frame();
+    /*frame->set("rescale.interp", "nearest");
+    frame->set("deinterlace_method", "onefield");
+    frame->set("top_field_first", -1 );*/
     QImage p = getFrame(frame, frameWidth, displayWidth, height);
     delete frame;
     return p;
@@ -226,8 +229,14 @@ QImage KThumb::getFrame(Mlt::Frame *frame, int frameWidth, int displayWidth, int
         } else {
             image = image.scaled(displayWidth, height, Qt::IgnoreAspectRatio).rgbSwapped();
         }
-        p.fill(QColor(100, 100, 100, 70).rgba());
+#if QT_VERSION >= 0x040800
+       p.fill(QColor(100, 100, 100, 70));
         QPainter painter(&p);
+#else
+       p.fill(Qt::transparent);
+       QPainter painter(&p);
+       painter.fillRect(p.rect(), QColor(100, 100, 100, 70));
+#endif
         painter.drawImage(p.rect(), image);
         painter.end();
     } else