Commit 7d053acc authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Workaround crash playing remote files in MLT 6.26.0

parent 3a36c4ac
......@@ -76,6 +76,8 @@
#include "dialogs/textbasededit.h"
#include "project/dialogs/temporarydata.h"
#include <framework/mlt_version.h>
#ifdef USE_JOGSHUTTLE
#include "jogshuttle/jogmanager.h"
#endif
......@@ -101,6 +103,7 @@
#include <kns3/knewstuffaction.h>
#include <ktogglefullscreenaction.h>
#include <kwidgetsaddons_version.h>
#include <KRun>
#include "kdenlive_debug.h"
#include <QAction>
......@@ -355,9 +358,14 @@ void MainWindow::init(const QString &mltPath)
auto *onlineResources = new ResourceWidget(this);
m_onlineResourcesDock = addDock(i18n("Online Resources"), QStringLiteral("onlineresources"), onlineResources);
connect(onlineResources, &ResourceWidget::previewClip, [&](const QString &path, const QString &title) {
qDebug()<<"MLT VER: "<<LIBMLT_VERSION_INT<<"; QTVER: "<<QT_VERSION_CHECK(6,26,0);
#if LIBMLT_VERSION_INT == QT_VERSION_CHECK(6,26,0)
new KRun(QUrl(path), this);
#else
m_clipMonitor->slotPreviewResource(path, title);
m_clipMonitorDock->show();
m_clipMonitorDock->raise();
#endif
});
connect(onlineResources, &ResourceWidget::addClip, this, &MainWindow::slotAddProjectClip);
......
......@@ -884,6 +884,10 @@ int GLWidget::setProducer(const QString &file)
m_producer.reset();
}
m_producer = std::make_shared<Mlt::Producer>(new Mlt::Producer(pCore->getCurrentProfile()->profile(), nullptr, file.toUtf8().constData()));
if (!m_producer && !m_producer->is_valid()) {
m_producer.reset();
m_producer = m_blackClip;
}
if (m_consumer) {
//m_consumer->stop();
if (!m_consumer->is_stopped()) {
......
......@@ -1736,7 +1736,6 @@ void Monitor::slotPreviewResource(const QString &path, const QString &title)
slotOpenClip(nullptr);
m_streamAction->setVisible(false);
m_glMonitor->setProducer(path);
m_glMonitor->producer();
m_timePos->setRange(0, m_glMonitor->producer()->get_length() - 1);
m_glMonitor->getControllerProxy()->setClipProperties(-1, ClipType::Unknown, false, title);
m_glMonitor->setRulerInfo(m_glMonitor->producer()->get_length() - 1);
......
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