]> git.sesse.net Git - kdenlive/commitdiff
Fix profiles
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 9 Feb 2008 19:43:04 +0000 (19:43 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 9 Feb 2008 19:43:04 +0000 (19:43 +0000)
svn path=/branches/KDE4/; revision=1827

src/kthumb.cpp
src/kthumb.h
src/renderer.cpp

index 3e474a0c6b5cbbb82a1aeab9744903f02f0b4044..663a0eb24b5896881598376be1a4107f6cae56bb 100644 (file)
 KThumb::KThumb(KUrl url, int width, int height, QObject * parent, const char *name):QObject(parent), m_url(url), m_width(width), m_height(height)
 {
   kDebug()<<"+++++++++++  CREATING THMB PROD FOR: "<<url;
-  m_profile = Mlt::Profile((char*) KdenliveSettings::current_profile().data());
+  m_profile = new Mlt::Profile((char*) qstrdup(KdenliveSettings::current_profile().toUtf8()));
 }
 
 KThumb::~KThumb()
 {
+    if (m_profile) delete m_profile;
     //if (thumbProducer.running ()) thumbProducer.exit();
 }
 
@@ -183,7 +184,7 @@ void KThumb::extractImage(int frame, int frame2)
     if (m_url.isEmpty()) return;
     QPixmap pix(m_width, m_height);
     char *tmp = Render::decodedString(m_url.path());
-    Mlt::Producer m_producer(m_profile, tmp);
+    Mlt::Producer m_producer(*m_profile, tmp);
     delete tmp;
 
     if (m_producer.is_blank()) {
@@ -193,7 +194,7 @@ void KThumb::extractImage(int frame, int frame2)
     }
     Mlt::Frame * m_frame;
     mlt_image_format format = mlt_image_rgb24a;
-    Mlt::Filter m_convert(m_profile, "avcolour_space");
+    Mlt::Filter m_convert(*m_profile, "avcolour_space");
     m_convert.set("forced", mlt_image_rgb24a);
     m_producer.attach(m_convert);
     if (frame != -1) {
index 2f2162fc5df454abbe13515030c2fa16af3e73c4..f249b071a9037f94425cb419449fcd92cb9c7a90 100644 (file)
@@ -87,7 +87,7 @@ private:
        QString m_thumbFile;
        int m_width;
        int m_height;
-       Mlt::Profile m_profile;
+       Mlt::Profile *m_profile;
 
 signals:
        void thumbReady(int frame, QPixmap pm);
index 618c65ad5902fd900490c2598b07ad51858409c1..f828dd63232b1374cbd6438878a378d9f292638b 100644 (file)
@@ -38,6 +38,7 @@ extern "C" {
 #include <KLocale>
 
 #include "renderer.h"
+#include "kdenlivesettings.h"
 
 static void consumer_frame_show(mlt_consumer, Render * self, mlt_frame frame_ptr)
 {
@@ -53,7 +54,8 @@ static void consumer_frame_show(mlt_consumer, Render * self, mlt_frame frame_ptr
 
 Render::Render(const QString & rendererName, int winid, int extid, QWidget *parent):QObject(parent), m_name(rendererName), m_mltConsumer(NULL), m_mltProducer(NULL), m_mltTextProducer(NULL), m_sceneList(QDomDocument()), m_winid(-1), m_framePosition(0), m_generateScenelist(false), isBlocked(true)
 {
-    m_mltProfile = new Mlt::Profile("pal_dv");
+    kDebug()<<"//////////  USING PROFILE: "<<qstrdup(KdenliveSettings::current_profile().toUtf8());
+    m_mltProfile = new Mlt::Profile((char*) qstrdup(KdenliveSettings::current_profile().toUtf8()));
     refreshTimer = new QTimer( this );
     connect( refreshTimer, SIGNAL(timeout()), this, SLOT( refresh()) );