Commit 048a3d74 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix crash when opening titler with movit GPU

parent 9aca0ee7
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment