cache: mild auto-cache overhaul
Shifted from CacheTask to functionality built into RenderBackend. It was a lot easier to control behavior this way without having to juggle a ton of threads and race conditions. Could likely be multithreaded further.
This commit is contained in:
Vendored
+1
-1
@@ -72,7 +72,7 @@ QFuture<void> CacheTask::DownloadFrame(FramePtr frame, const QByteArray &hash)
|
||||
void CacheTask::FrameDownloaded(const QByteArray &hash, const std::list<rational> ×)
|
||||
{
|
||||
foreach (const rational& t, times) {
|
||||
viewer()->video_frame_cache()->SetHash(t, hash, job_time());
|
||||
viewer()->video_frame_cache()->SetHash(t, hash, job_time(), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -189,10 +189,12 @@ void RenderTask::Render(const TimeRangeList& video_range,
|
||||
|
||||
while (!IsCancelled() && i != render_lookup_table.end()) {
|
||||
if (i->frame_future->IsFinished()) {
|
||||
FramePtr f = i->frame_future->Get().value<FramePtr>();
|
||||
if (!i->frame_future->WasCancelled()) {
|
||||
FramePtr f = i->frame_future->Get().value<FramePtr>();
|
||||
|
||||
// Start multithreaded download here
|
||||
download_futures.push_back({i->hash, DownloadFrame(f, i->hash)});
|
||||
// Start multithreaded download here
|
||||
download_futures.push_back({i->hash, DownloadFrame(f, i->hash)});
|
||||
}
|
||||
|
||||
i = render_lookup_table.erase(i);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user