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

Fix detection of missing timeline preview chunks on opening

parent 8e8313c4
......@@ -153,6 +153,10 @@ void PreviewManager::loadChunks(QVariantList previewChunks, QVariantList dirtyCh
break;
}
}
QStringList existingChuncks;
if (!previewChunks.isEmpty()) {
existingChuncks = m_cacheDir.entryList(QDir::Files);
}
int max = playlist.count();
std::shared_ptr<Mlt::Producer> clip;
......@@ -163,9 +167,13 @@ void PreviewManager::loadChunks(QVariantList previewChunks, QVariantList dirtyCh
}
int position = playlist.clip_start(i);
if (previewChunks.contains(QString::number(position))) {
clip.reset(playlist.get_clip(i));
m_renderedChunks << position;
m_previewTrack->insert_at(position, clip.get(), 1);
if (existingChuncks.contains(QString("%1.%2").arg(position).arg(m_extension))) {
clip.reset(playlist.get_clip(i));
m_renderedChunks << position;
m_previewTrack->insert_at(position, clip.get(), 1);
} else {
dirtyChunks << position;
}
}
}
m_previewTrack->consolidate_blanks();
......
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