From 24c926e769f1fff1ff1e1428426728aa9a649536 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sun, 16 Feb 2020 00:14:46 +1100 Subject: [PATCH] renderer: use ocio config in hash as well Fixes potential bug where the same named colorspace in a different config would pull old/likely inaccurate cached frames. --- app/render/backend/opengl/openglproxy.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/render/backend/opengl/openglproxy.cpp b/app/render/backend/opengl/openglproxy.cpp index bf92d4841..0bbf10da5 100644 --- a/app/render/backend/opengl/openglproxy.cpp +++ b/app/render/backend/opengl/openglproxy.cpp @@ -53,14 +53,15 @@ void OpenGLProxy::FrameToValue(StreamPtr stream, FramePtr frame, NodeValueTable ImageStreamPtr video_stream = std::static_pointer_cast(stream); // Set up OCIO context - OpenGLColorProcessorPtr color_processor = std::static_pointer_cast(color_cache_.Get(video_stream->colorspace())); + QString colorspace_match = QStringLiteral("%1:%2").arg(video_stream->footage()->project()->ocio_config(), video_stream->colorspace()); + + OpenGLColorProcessorPtr color_processor = std::static_pointer_cast(color_cache_.Get(colorspace_match)); if (!color_processor) { - // FIXME: We match with the colorspace string, but this won't change if the user sets a new config with a colorspace with the same string color_processor = OpenGLColorProcessor::CreateOpenGL(video_stream->footage()->project()->color_manager()->GetConfig(), video_stream->colorspace(), OCIO::ROLE_SCENE_LINEAR); - color_cache_.Add(video_stream->colorspace(), color_processor); + color_cache_.Add(colorspace_match, color_processor); } ColorManager::OCIOMethod ocio_method = ColorManager::GetOCIOMethodForMode(video_params_.mode());