Fix crash on profile change.

Related to #440
parent 31259763
......@@ -650,8 +650,13 @@ bool ProjectItemModel::requestAddBinClip(QString &id, const QDomElement &descrip
if (res) {
int loadJob = pCore->jobManager()->startJob<LoadJob>({id}, -1, QString(), description, std::bind(readyCallBack, id));
int thumbJob = pCore->jobManager()->startJob<ThumbJob>({id}, loadJob, QString(), 150, 0, true);
pCore->jobManager()->startJob<AudioThumbJob>({id}, loadJob, QString());
pCore->jobManager()->startJob<CacheJob>({id}, thumbJob, QString(), 150);
ClipType::ProducerType type = new_clip->clipType();
if (type == ClipType::AV || type == ClipType::Audio || type == ClipType::Playlist) {
pCore->jobManager()->startJob<AudioThumbJob>({id}, loadJob, QString());
}
if (type == ClipType::AV || type == ClipType::Video || type == ClipType::Playlist) {
pCore->jobManager()->startJob<CacheJob>({id}, thumbJob, QString(), 150);
}
}
return res;
}
......
......@@ -64,6 +64,10 @@ const QString CacheJob::getDescription() const
bool CacheJob::startJob()
{
// We reload here, because things may have changed since creation of this job
if (m_done) {
// Job aborted
return false;
}
m_binClip = pCore->projectItemModel()->getClipByBinID(m_clipId);
if (m_binClip->clipType() != ClipType::Video && m_binClip->clipType() != ClipType::AV && m_binClip->clipType() != ClipType::Playlist) {
// Don't create thumbnail for audio clips
......
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