Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

* Fix proxy not automatically created

* Fix crash creating proxy in some circumstances
* Fix monitor not refreshed after proxy state change
parent 81586dd6
......@@ -1721,6 +1721,13 @@ void Bin::reloadClip(const QString &id)
clip->reloadProducer();
}
void Bin::reloadMonitorIfActive(const QString &id)
{
if (m_monitor->activeClipId() == id) {
slotOpenCurrent();
}
}
QStringList Bin::getBinFolderClipIds(const QString &id) const
{
QStringList ids;
......@@ -2069,20 +2076,6 @@ void Bin::doDisplayMessage(const QString &text, KMessageWidget::MessageType type
}
}
void Bin::gotProxy(const QString &id, const QString &path)
{
// TODO refac : delete this
std::shared_ptr<ProjectClip> clip = m_itemModel->getClipByBinID(id);
if (clip) {
QDomDocument doc;
clip->setProducerProperty(QStringLiteral("kdenlive:proxy"), path);
QDomElement xml = clip->toXml(doc, true);
if (!xml.isNull()) {
pCore->jobManager()->startJob<LoadJob>({id}, -1, QString(), xml);
}
}
}
void Bin::refreshClip(const QString &id)
{
if (m_monitor->activeClipId() == id) {
......
......@@ -217,12 +217,12 @@ public:
const QString getDocumentProperty(const QString &key);
/** @brief A proxy clip was just created, pass it to the responsible item */
void gotProxy(const QString &id, const QString &path);
/** @brief Ask MLT to reload this clip's producer */
void reloadClip(const QString &id);
/** @brief refresh monitor (if clip changed) */
void reloadMonitorIfActive(const QString &id);
void doMoveClip(const QString &id, const QString &newParentId);
void doMoveFolder(const QString &id, const QString &newParentId);
void setupGeneratorMenu();
......
......@@ -379,6 +379,21 @@ bool ProjectClip::setProducer(std::shared_ptr<Mlt::Producer> producer, bool repl
getFileHash();
// set parent again (some info need to be stored in producer)
updateParent(parentItem().lock());
QList<std::shared_ptr<ProjectClip>> clipList;
// automatic proxy generation enabled
if (m_clipType == ClipType::Image && KdenliveSettings::generateimageproxy()) {
if (getProducerIntProperty(QStringLiteral("meta.media.width")) >= KdenliveSettings::proxyimageminsize() && getProducerProperty(QStringLiteral("kdenlive:proxy")) == QStringLiteral()) {
clipList << std::static_pointer_cast<ProjectClip>(shared_from_this());
}
} else if (KdenliveSettings::generateproxy() && (m_clipType == ClipType::AV || m_clipType == ClipType::Video)) {
if (getProducerIntProperty(QStringLiteral("meta.media.width")) >= KdenliveSettings::proxyminsize() && getProducerProperty(QStringLiteral("kdenlive:proxy")) == QStringLiteral()) {
clipList << std::static_pointer_cast<ProjectClip>(shared_from_this());
}
}
if (!clipList.isEmpty()) {
pCore->currentDoc()->slotProxyCurrentItem(true, clipList, false);
}
pCore->bin()->reloadMonitorIfActive(clipId());
return true;
}
......@@ -749,6 +764,7 @@ bool ProjectClip::hasProxy() const
void ProjectClip::setProperties(const QMap<QString, QString> &properties, bool refreshPanel)
{
qDebug()<<"// SETTING CLIP PROPERTIES: "<<properties;
QMapIterator<QString, QString> i(properties);
QMap<QString, QString> passProperties;
bool refreshAnalysis = false;
......
......@@ -253,7 +253,7 @@ bool ProxyJob::startJob()
m_done = false;
m_errorMessage.append(QString::fromUtf8(m_jobProcess->readAll()));
}
delete m_jobProcess;
m_jobProcess->deleteLater();
return result;
}
......
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