viewer: further improvements to auto-cache logic

This commit is contained in:
itsmattkc
2021-05-09 18:15:56 +10:00
parent db237d3bd4
commit 964129bb08
3 changed files with 55 additions and 46 deletions
+4 -9
View File
@@ -35,7 +35,10 @@ RenderTicketPtr PreviewAutoCacher::GetSingleFrame(const rational &t, bool priori
{
CancelQueuedSingleFrameRender();
QByteArray hash = viewer_node_->video_frame_cache()->GetHash(t);
QByteArray hash;
if (!paused_) {
hash = viewer_node_->video_frame_cache()->GetHash(t);
}
auto sfr = std::make_shared<RenderTicket>();
sfr->Start();
@@ -53,14 +56,6 @@ RenderTicketPtr PreviewAutoCacher::GetSingleFrame(const rational &t, bool priori
void PreviewAutoCacher::SetPaused(bool paused)
{
paused_ = paused;
if (paused_) {
// Pause the autocache
ClearVideoQueue();
} else {
// Unpause the cache
RequeueFrames();
}
}
void PreviewAutoCacher::GenerateHashes(ViewerOutput *viewer, FrameHashCache* cache, const QVector<rational> &times, qint64 job_time)