Fix crash on newly created profile change

Fix bin clip duration corrupted if reloading or selecting another clip while in play/loop zone mode
parent ff3097ac
Pipeline #3039 passed with stage
in 19 minutes and 17 seconds
......@@ -199,8 +199,6 @@ void ProjectClip::updateAudioThumbnail(QList<double> audioLevels)
if (auto ptr = m_model.lock()) {
emit std::static_pointer_cast<ProjectItemModel>(ptr)->refreshAudioThumbs(m_binId);
}
qDebug() << " * ** * YOP AUDIO LEF CHANGED";
updateTimelineClips({TimelineModel::AudioLevelsRole});
}
bool ProjectClip::audioThumbCreated() const
......
......@@ -31,6 +31,7 @@
#include "macros.hpp"
#include "profiles/profilemodel.hpp"
#include "project/dialogs/slideshowclip.h"
#include "monitor/monitor.h"
#include "xml/xml.hpp"
#include <KMessageWidget>
#include <QMimeDatabase>
......@@ -248,6 +249,7 @@ bool LoadJob::startJob()
if (m_done) {
return true;
}
pCore->getMonitor(Kdenlive::ClipMonitor)->resetPlayOrLoopZone(m_clipId);
m_resource = Xml::getXmlProperty(m_xml, QStringLiteral("resource"));
ClipType::ProducerType type = static_cast<ClipType::ProducerType>(m_xml.attribute(QStringLiteral("type")).toInt());
QString service = Xml::getXmlProperty(m_xml, QStringLiteral("mlt_service"));
......
......@@ -543,6 +543,7 @@ void ClipController::setProducerProperty(const QString &name, const QString &val
void ClipController::resetProducerProperty(const QString &name)
{
// TODO: also set property on all track producers
if (!m_masterProducer) return;
m_masterProducer->parent().set(name.toUtf8().constData(), (char *)nullptr);
}
......
......@@ -1301,6 +1301,13 @@ void Monitor::slotPlay()
m_playAction->trigger();
}
void Monitor::resetPlayOrLoopZone(const QString &binId)
{
if (activeClipId() == binId) {
m_glMonitor->resetZoneMode();
}
}
void Monitor::slotPlayZone()
{
slotActivateMonitor();
......@@ -1347,6 +1354,7 @@ void Monitor::updateClipProducer(const QString &playlist)
void Monitor::slotOpenClip(const std::shared_ptr<ProjectClip> &controller, int in, int out)
{
if (m_controller) {
m_glMonitor->resetZoneMode();
disconnect(m_controller->getMarkerModel().get(), SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &, const QVector<int> &)), this,
SLOT(checkOverlay()));
disconnect(m_controller->getMarkerModel().get(), SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SLOT(checkOverlay()));
......@@ -1404,7 +1412,7 @@ void Monitor::slotOpenClip(const std::shared_ptr<ProjectClip> &controller, int i
const QString Monitor::activeClipId()
{
if (m_controller) {
return m_controller->AbstractProjectItem::clipId();
return m_controller->clipId();
}
return QString();
}
......
......@@ -158,6 +158,8 @@ public:
void slotZoomOut();
/** @brief Set a property on the MLT consumer */
void setConsumerProperty(const QString &name, const QString &value);
/** @brief Play or Loop zone sets a fake "out" on the producer. It is necessary to reset this before reloading the producer */
void resetPlayOrLoopZone(const QString &binId);
protected:
void mousePressEvent(QMouseEvent *event) override;
......
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