diff --git a/app/render/backend/opengl/openglbackend.cpp b/app/render/backend/opengl/openglbackend.cpp index 6f8dbe184..ec4a61d45 100644 --- a/app/render/backend/opengl/openglbackend.cpp +++ b/app/render/backend/opengl/openglbackend.cpp @@ -141,7 +141,7 @@ void OpenGLBackend::DecompileInternal() shader_cache_.Clear(); } -void OpenGLBackend::EmitCachedFrameReady(const rational &time, const QVariant &value) +void OpenGLBackend::EmitCachedFrameReady(const QList ×, const QVariant &value) { OpenGLTextureCache::ReferencePtr ref = value.value(); OpenGLTexturePtr tex; @@ -152,7 +152,9 @@ void OpenGLBackend::EmitCachedFrameReady(const rational &time, const QVariant &v tex = nullptr; } - emit CachedFrameReady(time, QVariant::fromValue(tex)); + foreach (const rational& t, times) { + emit CachedFrameReady(t, QVariant::fromValue(tex)); + } } OpenGLTexturePtr OpenGLBackend::CopyTexture(OpenGLTexturePtr input) diff --git a/app/render/backend/opengl/openglbackend.h b/app/render/backend/opengl/openglbackend.h index 30638c00e..506e5c81a 100644 --- a/app/render/backend/opengl/openglbackend.h +++ b/app/render/backend/opengl/openglbackend.h @@ -28,7 +28,7 @@ protected: virtual void DecompileInternal() override; - virtual void EmitCachedFrameReady(const rational& time, const QVariant& value) override; + virtual void EmitCachedFrameReady(const QList ×, const QVariant& value) override; private: OpenGLTexturePtr CopyTexture(OpenGLTexturePtr input); diff --git a/app/render/backend/videorenderbackend.cpp b/app/render/backend/videorenderbackend.cpp index a735e328d..284c3e16e 100644 --- a/app/render/backend/videorenderbackend.cpp +++ b/app/render/backend/videorenderbackend.cpp @@ -253,16 +253,21 @@ void VideoRenderBackend::ThreadCompletedFrame(NodeDependency path, QByteArray ha QVariant texture = table.Get(NodeParam::kTexture); // Check if this frame has changed once again, in which case we may not want to draw it (it'll look jittery to the user) + QList times_with_this_hash; + if (last_time_requested_ == path.in() || export_mode_) { - EmitCachedFrameReady(path.in(), texture); + times_with_this_hash.append(path.in()); } if (export_mode_) { - QList times_with_this_hash = frame_cache()->DeferredMapsWithHash(hash); - foreach (const rational& t, times_with_this_hash) { - EmitCachedFrameReady(t, texture); - } - } else { + times_with_this_hash.append(frame_cache()->DeferredMapsWithHash(hash)); + } + + if (!times_with_this_hash.isEmpty()) { + EmitCachedFrameReady(times_with_this_hash, texture); + } + + if (!export_mode_) { if (texture.isNull()) { // No frame received, we set hash to an empty frame_cache()->RemoveHash(path.in(), hash); diff --git a/app/render/backend/videorenderbackend.h b/app/render/backend/videorenderbackend.h index e69841e90..07af2c6fa 100644 --- a/app/render/backend/videorenderbackend.h +++ b/app/render/backend/videorenderbackend.h @@ -97,7 +97,7 @@ protected: virtual void ConnectWorkerToThis(RenderWorker* processor) override; - virtual void EmitCachedFrameReady(const rational& time, const QVariant& value) = 0; + virtual void EmitCachedFrameReady(const QList ×, const QVariant& value) = 0; bool export_mode_;