Hello,

Actually this is Kdenlive bug 375094, fixed just after 16.12.1 release :(
See Kdenlive revert commit 8a20fca86e9e2ce3d04b3e024b0752e19f9d8c8e
(attached as patch)

Actually the following commit in 16.12 branch also fixes NVidia crash with GPU 
effects:
kdenlive commit 754b8eeed8c1a874a5535eb5136b02841a812180
(attached too)

maybe worth to include in a 16.12.1-2 for stretch users, if not too late? 
(16.12.2 won't come on time)

Cheers and thanks to all,

Vincent
>From 8a20fca86e9e2ce3d04b3e024b0752e19f9d8c8e Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Mardelle <j...@kdenlive.org>
Date: Mon, 16 Jan 2017 20:06:00 +0100
Subject: [PATCH 1/9] Revert "Fix warning about QOffscreenSurface thread"
 Caused startup crash on NVidia cards CCBUG: 375094

This reverts commit 6675c4a509046aa3b57c60cbc3f31435e09c2df7.
---
 src/monitor/glwidget.cpp | 10 +++-------
 src/monitor/glwidget.h   |  1 -
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/monitor/glwidget.cpp b/src/monitor/glwidget.cpp
index e4089e661..cd4f56add 100644
--- a/src/monitor/glwidget.cpp
+++ b/src/monitor/glwidget.cpp
@@ -109,7 +109,6 @@ GLWidget::GLWidget(int id, QObject *parent)
         mlt_properties_set_data(mlt_global_properties(), "glslManager", NULL, 0, NULL, NULL);
         emit gpuNotSupported();
     }
-    connect(this, SIGNAL(sceneGraphInitialized()), SLOT(createOffscreen()));
     connect(this, SIGNAL(sceneGraphInitialized()), SLOT(initializeGL()), Qt::DirectConnection);
     connect(this, SIGNAL(beforeRendering()), SLOT(paintGL()), Qt::DirectConnection);
 }
@@ -143,17 +142,14 @@ void GLWidget::updateAudioForAnalysis()
 	m_frameRenderer->sendAudioForAnalysis = KdenliveSettings::monitor_audio();
 }
 
-void GLWidget::createOffscreen()
+void GLWidget::initializeGL()
 {
+    if (m_isInitialized || !isVisible() || !openglContext()) return;
     if (!m_offscreenSurface.isValid()) {
         m_offscreenSurface.setFormat(openglContext()->format());
         m_offscreenSurface.create();
+        openglContext()->makeCurrent(this);
     }
-}
-
-void GLWidget::initializeGL()
-{
-    if (m_isInitialized || !isVisible() || !openglContext()) return;
     initializeOpenGLFunctions();
     qDebug() << "OpenGL vendor: " << QString::fromUtf8((const char*) glGetString(GL_VENDOR));
     qDebug() << "OpenGL renderer: " << QString::fromUtf8((const char*) glGetString(GL_RENDERER));
diff --git a/src/monitor/glwidget.h b/src/monitor/glwidget.h
index dc1e0e2f3..d12500a57 100644
--- a/src/monitor/glwidget.h
+++ b/src/monitor/glwidget.h
@@ -182,7 +182,6 @@ private slots:
     void updateTexture(GLuint yName, GLuint uName, GLuint vName);
     void paintGL();
     void onFrameDisplayed(const SharedFrame &frame);
-    void createOffscreen();
 
 protected:
     void resizeEvent(QResizeEvent* event);
-- 
2.11.0

>From 754b8eeed8c1a874a5535eb5136b02841a812180 Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Mardelle <j...@kdenlive.org>
Date: Fri, 20 Jan 2017 01:15:01 +0100
Subject: [PATCH 2/9] Fix NVIDIA crash with GPU accel (movit)

---
 src/main.cpp                        |  2 +-
 src/mltcontroller/producerqueue.cpp | 14 +++++++++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/main.cpp b/src/main.cpp
index fc93963de..b081e056f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -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
diff --git a/src/mltcontroller/producerqueue.cpp b/src/mltcontroller/producerqueue.cpp
index 07fd234d3..aa06cf6fb 100644
--- a/src/mltcontroller/producerqueue.cpp
+++ b/src/mltcontroller/producerqueue.cpp
@@ -299,7 +299,19 @@ void ProducerQueue::processFileProperties()
                 } else if (service.contains(QStringLiteral("avformat"))) {
                     Mlt::Profile *blankProfile = new Mlt::Profile();
                     blankProfile->set_explicit(false);
-                    blankProfile->from_producer(*producer);
+                    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();
-- 
2.11.0

Reply via email to