playbackcache: more intelligent job matching

Ensures audio ranges can be anticipated and accurately ignored if they're
old or acknowledged if they're current.
This commit is contained in:
itsmattkc
2020-06-05 15:23:16 +10:00
parent b143b39869
commit 7609754103
5 changed files with 141 additions and 103 deletions
+13 -1
View File
@@ -45,7 +45,19 @@ void FrameHashCache::SetHash(const rational &time, const QByteArray &hash, const
{
QMutexLocker locker(lock());
if (!JobIsCurrent(TimeRange(time, time), job_time)) {
bool is_current = false;
for (int i=jobs_.size()-1; i>=0; i--) {
const JobIdentifier& job = jobs_.at(i);
if (job.range.Contains(time)
&& job_time >= job.job_time) {
is_current = true;
break;
}
}
if (!is_current) {
return;
}