cache: use render job times to synchronize cache

Ensure old inaccurate jobs are never prioritized over current jobs.
This commit is contained in:
itsmattkc
2020-06-04 16:48:23 +10:00
parent cc34f0e251
commit 9ff9817b95
13 changed files with 106 additions and 40 deletions
+5 -1
View File
@@ -41,10 +41,14 @@ QByteArray FrameHashCache::GetHash(const rational &time)
return time_hash_map_.value(time);
}
void FrameHashCache::SetHash(const rational &time, const QByteArray &hash)
void FrameHashCache::SetHash(const rational &time, const QByteArray &hash, const qint64& job_time)
{
QMutexLocker locker(lock());
if (!JobIsCurrent(TimeRange(time, time), job_time)) {
return;
}
time_hash_map_.insert(time, hash);
TimeRange validated_range(time, time + timebase_);