summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <[email protected]>2017-01-20 17:16:39 (GMT)
committerJean-Baptiste Mardelle <[email protected]>2017-01-20 17:16:39 (GMT)
commit048a3d746459fc2f0dd68aa350e96c771b1e8a53 (patch)
treee7fbe90357552937dd42594e86fe0771ec8a61fa
parent9aca0ee731bcb3db2e9924901e339555bdfa1f20 (diff)
Fix crash when opening titler with movit GPU
-rw-r--r--src/doc/kthumb.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/doc/kthumb.cpp b/src/doc/kthumb.cpp
index 64728c9..92aeeaf 100644
--- a/src/doc/kthumb.cpp
+++ b/src/doc/kthumb.cpp
@@ -44,6 +44,16 @@ QPixmap KThumb::getImage(const QUrl &url, int frame, int width, int height)
QPixmap pix(width, height);
if (!url.isValid()) return pix;
Mlt::Producer *producer = new Mlt::Producer(profile, url.toLocalFile().toUtf8().constData());
+ if (KdenliveSettings::gpu_accel()) {
+ QString service = producer->get("mlt_service");
+ QString res = producer->get("resource");
+ delete producer;
+ producer = new Mlt::Producer(profile, service.toUtf8().constData(), res.toUtf8().constData());
+ Mlt::Filter scaler(profile, "swscale");
+ Mlt::Filter converter(profile, "avcolor_space");
+ producer->attach(scaler);
+ producer->attach(converter);
+ }
pix = QPixmap::fromImage(getFrame(producer, frame, width, height));
delete producer;
return pix;