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

Fix crash on profile change.

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