clear frame caches and renderers if the viewer node is ever changed

Clears the state if a viewer node is disconnected.
This commit is contained in:
itsmattkc
2020-01-03 21:17:20 +11:00
parent 3369bb53f9
commit 3a8a509f1a
6 changed files with 36 additions and 11 deletions
@@ -10,6 +10,17 @@ VideoRenderFrameCache::VideoRenderFrameCache()
}
void VideoRenderFrameCache::Clear()
{
time_hash_map_.clear();
currently_caching_lock_.lock();
currently_caching_list_.clear();
currently_caching_lock_.unlock();
cache_id_.clear();
}
bool VideoRenderFrameCache::HasHash(const QByteArray &hash)
{
return QFileInfo::exists(CachePathName(hash)) && !IsCaching(hash);
@@ -43,6 +54,8 @@ bool VideoRenderFrameCache::TryCache(const rational& time, const QByteArray &has
void VideoRenderFrameCache::SetCacheID(const QString &id)
{
Clear();
cache_id_ = id;
}