From 3c139b8274d4b153b7cf91f87b26ef4a35f50bd0 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Fri, 17 Jan 2020 14:12:13 +1100 Subject: [PATCH] fixed bug where deleting clips in currently caching sequences would fail to cache when something took its place --- app/render/backend/videorenderbackend.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/render/backend/videorenderbackend.cpp b/app/render/backend/videorenderbackend.cpp index 8a2eb89e1..5c15081ad 100644 --- a/app/render/backend/videorenderbackend.cpp +++ b/app/render/backend/videorenderbackend.cpp @@ -344,6 +344,17 @@ void VideoRenderBackend::TruncateFrameCacheLength(const rational &length) { // Remove frames after this time code if it's changed frame_cache_.Truncate(length); + + invalidated_.RemoveTimeRange(TimeRange(length, RATIONAL_MAX)); + + // If the playhead is past the length, update the viewer to a null texture because it won't be cached through the + // queue, but will now be a null texture + if (last_time_requested_ >= length) { + emit CachedFrameReady(last_time_requested_, QVariant(), QDateTime::currentMSecsSinceEpoch()); + } + + // Adjust queue for new invalidated range + Requeue(); } void VideoRenderBackend::FrameRemovedFromDiskCache(const QByteArray &hash)