Commit 754b8eee authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix NVIDIA crash with GPU accel (movit)

parent 8a20fca8
......@@ -44,7 +44,7 @@ int main(int argc, char *argv[])
// Force QDomDocument to use a deterministic XML attribute order
extern Q_CORE_EXPORT QBasicAtomicInt qt_qhash_seed;
qt_qhash_seed.store(0);
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
QCoreApplication::setAttribute(Qt::AA_X11InitThreads);
#endif
......
......@@ -299,7 +299,19 @@ void ProducerQueue::processFileProperties()
} else if (service.contains(QStringLiteral("avformat"))) {
Mlt::Profile *blankProfile = new Mlt::Profile();
blankProfile->set_explicit(false);
if (KdenliveSettings::gpu_accel()) {
Clip clp(*producer);
Mlt::Producer *glProd = clp.softClone(ClipController::getPassPropertiesList());
Mlt::Filter scaler(*m_binController->profile(), "swscale");
Mlt::Filter converter(*m_binController->profile(), "avcolor_space");
glProd->attach(scaler);
glProd->attach(converter);
blankProfile->from_producer(*glProd);
delete glProd;
}
else {
blankProfile->from_producer(*producer);
}
MltVideoProfile clipProfile = ProfilesDialog::getVideoProfile(*blankProfile);
MltVideoProfile projectProfile = ProfilesDialog::getVideoProfile(*m_binController->profile());
clipProfile.adjustWidth();
......
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