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

delay cache job to allow faster clip loading

parent f6a255ef
...@@ -497,6 +497,11 @@ bool ProjectClip::setProducer(std::shared_ptr<Mlt::Producer> producer, bool repl ...@@ -497,6 +497,11 @@ bool ProjectClip::setProducer(std::shared_ptr<Mlt::Producer> producer, bool repl
m_videoProducers.clear(); m_videoProducers.clear();
m_timewarpProducers.clear(); m_timewarpProducers.clear();
emit refreshPropertiesPanel(); emit refreshPropertiesPanel();
if (m_clipType == ClipType::AV || m_clipType == ClipType::Video || m_clipType == ClipType::Playlist) {
QTimer::singleShot(1000, this, [this]() {
pCore->jobManager()->startJob<CacheJob>({m_binId}, -1, QString());
});
}
replaceInTimeline(); replaceInTimeline();
return true; return true;
} }
......
...@@ -693,9 +693,6 @@ bool ProjectItemModel::requestAddBinClip(QString &id, const QDomElement &descrip ...@@ -693,9 +693,6 @@ bool ProjectItemModel::requestAddBinClip(QString &id, const QDomElement &descrip
if (type == ClipType::AV || type == ClipType::Audio || type == ClipType::Playlist || type == ClipType::Unknown) { if (type == ClipType::AV || type == ClipType::Audio || type == ClipType::Playlist || type == ClipType::Unknown) {
pCore->jobManager()->startJob<AudioThumbJob>({id}, loadJob, QString()); pCore->jobManager()->startJob<AudioThumbJob>({id}, loadJob, QString());
} }
if (type == ClipType::AV || type == ClipType::Video || type == ClipType::Playlist || type == ClipType::Unknown) {
pCore->jobManager()->startJob<CacheJob>({id}, loadJob, QString());
}
} }
return res; return res;
} }
......
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