render: handle missing cache frames
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user