render: handle missing cache frames

This commit is contained in:
itsmattkc
2022-06-06 20:06:55 -07:00
parent eeea16c5c3
commit 1b1259225e
2 changed files with 18 additions and 1 deletions
+14 -1
View File
@@ -26,6 +26,7 @@
#include "codec/conformmanager.h"
#include "node/inputdragger.h"
#include "node/project/project.h"
#include "render/diskmanager.h"
#include "render/renderprocessor.h"
#include "task/customcache/customcachetask.h"
#include "task/taskmanager.h"
@@ -201,7 +202,12 @@ void PreviewAutoCacher::VideoRendered()
if (watcher->HasResult()) {
if (watcher->GetTicket()->property("cached").toBool()) {
if (FrameHashCache *cache = Node::ValueToPtr<FrameHashCache>(watcher->property("cache"))) {
cache->ValidateTime(watcher->property("time").value<rational>());
rational time = watcher->property("time").value<rational>();
JobTime job = watcher->property("job").value<JobTime>();
if (video_cache_data_.value(cache).job_tracker.isCurrent(time, job)) {
cache->ValidateTime(time);
}
}
}
}
@@ -210,6 +216,13 @@ void PreviewAutoCacher::VideoRendered()
TryRender();
}
const QStringList bad_cache_names = watcher->GetTicket()->property("badcache").toStringList();
if (!bad_cache_names.empty()) {
for (const QString &fn : bad_cache_names) {
DiskManager::instance()->DeleteSpecificFile(fn);
}
}
// Process passthroughs no matter what, if the viewer was switched, the passthrough map would be
// cleared anyway
QVector<RenderTicketPtr> tickets = video_immediate_passthroughs_.take(watcher);
+4
View File
@@ -573,6 +573,10 @@ TexturePtr RenderProcessor::ProcessVideoCacheJob(const CacheJob &val)
tex->Upload(frame->data(), frame->linesize_pixels());
return tex;
}
} else {
QStringList s = ticket_->property("badcache").toStringList();
s.append(val.GetFilename());
ticket_->setProperty("badcache", s);
}
return nullptr;