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:
@@ -60,6 +60,8 @@ void VideoRenderBackend::DisconnectViewer(ViewerOutput *node)
|
||||
disconnect(node, &ViewerOutput::VideoChangedBetween, this, &VideoRenderBackend::InvalidateCache);
|
||||
disconnect(node, &ViewerOutput::VideoGraphChanged, this, &VideoRenderBackend::QueueRecompile);
|
||||
disconnect(node, &ViewerOutput::LengthChanged, this, &VideoRenderBackend::TruncateFrameCacheLength);
|
||||
|
||||
frame_cache_.Clear();
|
||||
}
|
||||
|
||||
const VideoRenderingParams &VideoRenderBackend::params() const
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ class VideoRenderFrameCache
|
||||
public:
|
||||
VideoRenderFrameCache();
|
||||
|
||||
void Clear();
|
||||
|
||||
/**
|
||||
* @brief Return whether a frame with this hash already exists
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user