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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user