Commit dfee6c18 authored by Julius Künzel's avatar Julius Künzel 💬
Browse files

Fix thumbnails for loopable clips

parent b5efba98
Pipeline #239317 passed with stage
in 5 minutes and 41 seconds
......@@ -34,6 +34,11 @@ QImage ThumbnailProvider::requestImage(const QString &id, QSize *size, const QSi
if (ok) {
std::shared_ptr<ProjectClip> binClip = pCore->projectItemModel()->getClipByBinID(binId);
if (binClip) {
int duration = binClip->frameDuration();
if (frameNumber > duration) {
// for endless loopable clips, we rewrite the the position
frameNumber = frameNumber - ((frameNumber / duration) * duration);
}
result = ThumbnailCache::get()->getThumbnail(binClip->hashForThumbs(), binId, frameNumber);
if (!result.isNull()) {
*size = result.size();
......
Supports Markdown
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