improved renderer reliability

The renderer backend can now distinguish between jobs. Previously if two jobs
of the same frame were started (which is legal if the user made a change while
frames were still being rendered), an earlier job in some situations could
finish AFTER a later job, and the backend would have no way of distinguishing
between them. This meant a frame could be erroneously set to an old value
rather than the newest. This commit introduces job identification so that old
jobs are automatically discarded.
This commit is contained in:
itsmattkc
2020-01-02 03:21:38 +11:00
parent 62e94ca2cb
commit e8fddc2d5b
12 changed files with 147 additions and 160 deletions
+1 -27
View File
@@ -32,9 +32,7 @@ bool VideoRenderFrameCache::TryCache(const rational& time, const QByteArray &has
bool is_caching = currently_caching_list_.contains(hash);
if (is_caching) {
deferred_maps_.insert(time, hash);
} else {
if (!is_caching) {
currently_caching_list_.append(hash);
}
@@ -82,30 +80,6 @@ void VideoRenderFrameCache::Truncate(const rational &time)
}
}
QList<rational> VideoRenderFrameCache::DeferredMapsWithHash(const QByteArray &hash)
{
QList<rational> list;
currently_caching_lock_.lock();
QMap<rational, QByteArray>::iterator iterator = deferred_maps_.begin();
while (iterator != deferred_maps_.end()) {
if (iterator.value() == hash) {
list.append(iterator.key());
iterator = deferred_maps_.erase(iterator);
} else {
iterator++;
}
}
currently_caching_list_.removeOne(hash);
currently_caching_lock_.unlock();
return list;
}
void VideoRenderFrameCache::RemoveHashFromCurrentlyCaching(const QByteArray &hash)
{
currently_caching_lock_.lock();