Commit 9b89f4ee authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

No need to load bin thumbnails twice

parent 8a7bca29
Pipeline #63351 passed with stage
in 9 minutes and 49 seconds
...@@ -486,9 +486,8 @@ QPixmap ProjectClip::thumbnail(int width, int height) ...@@ -486,9 +486,8 @@ QPixmap ProjectClip::thumbnail(int width, int height)
return m_thumbnail.pixmap(width, height); return m_thumbnail.pixmap(width, height);
} }
bool ProjectClip::setProducer(std::shared_ptr<Mlt::Producer> producer, bool replaceProducer) bool ProjectClip::setProducer(std::shared_ptr<Mlt::Producer> producer)
{ {
Q_UNUSED(replaceProducer)
qDebug() << "################### ProjectClip::setproducer"; qDebug() << "################### ProjectClip::setproducer";
QMutexLocker locker(&m_producerMutex); QMutexLocker locker(&m_producerMutex);
FileStatus::ClipStatus currentStatus = m_clipStatus; FileStatus::ClipStatus currentStatus = m_clipStatus;
...@@ -532,7 +531,6 @@ bool ProjectClip::setProducer(std::shared_ptr<Mlt::Producer> producer, bool repl ...@@ -532,7 +531,6 @@ bool ProjectClip::setProducer(std::shared_ptr<Mlt::Producer> producer, bool repl
getFileHash(); getFileHash();
// set parent again (some info need to be stored in producer) // set parent again (some info need to be stored in producer)
updateParent(parentItem().lock()); updateParent(parentItem().lock());
ClipLoadTask::start({ObjectType::BinClip,m_binId.toInt()}, QDomElement(), true, -1, -1, this);
AudioLevelsTask::start({ObjectType::BinClip, m_binId.toInt()}, this, false); AudioLevelsTask::start({ObjectType::BinClip, m_binId.toInt()}, this, false);
pCore->bin()->reloadMonitorIfActive(clipId()); pCore->bin()->reloadMonitorIfActive(clipId());
for (auto &p : m_audioProducers) { for (auto &p : m_audioProducers) {
......
...@@ -297,7 +297,7 @@ public slots: ...@@ -297,7 +297,7 @@ public slots:
* @param replaceProducer If true, we replace existing producer with this one * @param replaceProducer If true, we replace existing producer with this one
* @returns true if producer was changed * @returns true if producer was changed
* . */ * . */
bool setProducer(std::shared_ptr<Mlt::Producer> producer, bool replaceProducer); bool setProducer(std::shared_ptr<Mlt::Producer> producer);
void importJsonMarkers(const QString &json); void importJsonMarkers(const QString &json);
......
...@@ -671,8 +671,7 @@ void ClipLoadTask::run() ...@@ -671,8 +671,7 @@ void ClipLoadTask::run()
if (!m_isCanceled) { if (!m_isCanceled) {
auto binClip = pCore->projectItemModel()->getClipByBinID(QString::number(m_owner.second)); auto binClip = pCore->projectItemModel()->getClipByBinID(QString::number(m_owner.second));
if (binClip) { if (binClip) {
QMetaObject::invokeMethod(binClip.get(), "setProducer", Qt::QueuedConnection, Q_ARG(std::shared_ptr<Mlt::Producer>,producer), QMetaObject::invokeMethod(binClip.get(), "setProducer", Qt::QueuedConnection, Q_ARG(std::shared_ptr<Mlt::Producer>,producer));
Q_ARG(bool , true));
if (m_xml.hasAttribute(QStringLiteral("_checkProfile")) && producer->get_int("video_index") > -1) { if (m_xml.hasAttribute(QStringLiteral("_checkProfile")) && producer->get_int("video_index") > -1) {
checkProfile(producer); checkProfile(producer);
} }
......
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