+ if (frame2 != -1) {
+ QPixmap pix = getFrame(&m_producer, frame2, m_width, m_height);
+ emit thumbReady(frame2, pix);
+ }
+
+}
+
+QPixmap KThumb::getImage(KUrl url, int frame, int width, int height) {
+ Mlt::Profile profile((char*) KdenliveSettings::current_profile().data());
+ QPixmap pix(width, height);
+ if (url.isEmpty()) return pix;
+ char *tmp = Render::decodedString(url.path());
+ Mlt::Producer producer(profile, tmp);
+ delete[] tmp;
+
+ if (producer.is_blank()) {
+
+ pix.fill(Qt::black);
+ return pix;
+ }
+ return getFrame(&producer, frame, width, height);
+
+}
+
+QPixmap KThumb::getFrame(Mlt::Producer* producer, int frame, int width, int height) {
+ Mlt::Profile profile((char*) KdenliveSettings::current_profile().data());
+ Mlt::Filter m_convert(profile, "avcolour_space");
+ m_convert.set("forced", mlt_image_rgb24a);
+ producer->attach(m_convert);
+
+ producer->seek(frame);
+ Mlt::Frame * m_frame = producer->get_frame();
+ mlt_image_format format = mlt_image_rgb24a;
+ QPixmap pix(width, height);