]> git.sesse.net Git - kdenlive/blobdiff - src/kthumb.cpp
* Several fixes to clip resizing & cutting
[kdenlive] / src / kthumb.cpp
index b43098b71f9e4ab3f1bcd86ba96dc966379484a8..f6cfc7c4d03ed89b20f904d64c4ea963313d6d69 100644 (file)
  *                                                                         *
  ***************************************************************************/
 
+#include <qxml.h>
+#include <QImage>
+#include <QApplication>
+#include <QCryptographicHash>
+
 #include <kio/netaccess.h>
 #include <kdebug.h>
 #include <klocale.h>
 
 #include <mlt++/Mlt.h>
 
-#include <qxml.h>
-#include <qimage.h>
-
-#include <QThread>
-#include <QApplication>
-#include <QCryptographicHash>
-
 #include "clipmanager.h"
 #include "renderer.h"
 #include "kthumb.h"
 #include "kdenlivesettings.h"
 #include "events.h"
 
+
 void MyThread::init(QObject *parent, KUrl url, QString target, double frame, double frameLength, int frequency, int channels, int arrayWidth) {
     stop_me = false;
     m_parent = parent;
@@ -159,11 +158,7 @@ QPixmap KThumb::getImage(KUrl url, int width, int height) {
 }
 
 void KThumb::extractImage(int frame, int frame2) {
-    if (m_url.isEmpty()) return;
-    if (m_producer == NULL) return;
-    /*char *tmp = Render::decodedString("<westley><playlist><producer resource=\"" + m_url.path() + "\" /></playlist></westley>");
-    Mlt::Producer producer(*m_profile, "westley-xml", tmp);
-    delete[] tmp;*/
+    if (m_url.isEmpty() || !KdenliveSettings::videothumbnails() || m_producer == NULL) return;
 
     int twidth = (int)(KdenliveSettings::trackheight() * m_dar);
     if (m_producer->is_blank()) {
@@ -223,7 +218,6 @@ QPixmap KThumb::getImage(QDomElement xml, int frame, int width, int height) {
 
 //static
 QPixmap KThumb::getFrame(Mlt::Producer producer, int framepos, int width, int height) {
-
     producer.seek(framepos);
     Mlt::Frame *frame = producer.get_frame();
     mlt_image_format format = mlt_image_yuv422;