From 69e65f6784a002377bf7ef3c19fb5d3b4b5d848d Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Tue, 17 Mar 2020 03:13:14 +1100 Subject: [PATCH] viewer: fixed occasional OCIO bug Addresses a flaw where if the user changed the OCIO "display", Olive wouldn't check whether the currently selected "view" still existed in the new display or not which would create an invalid color processor if not. This commit now checks whether the new display contains the current view, and sets the default view for the new display if not. --- app/widget/viewer/viewerglwidget.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/widget/viewer/viewerglwidget.cpp b/app/widget/viewer/viewerglwidget.cpp index ca34dafd8..ccd5ed595 100644 --- a/app/widget/viewer/viewerglwidget.cpp +++ b/app/widget/viewer/viewerglwidget.cpp @@ -129,6 +129,14 @@ void ViewerGLWidget::SetImage(const QString &fn) void ViewerGLWidget::SetOCIODisplay(const QString &display) { ocio_display_ = display; + + // Determine if the selected view is available in this display + if (color_manager_ + && !color_manager_->ListAvailableViews(ocio_display_).contains(ocio_view_)) { + // If not, set to the default view for this display + ocio_view_ = color_manager_->GetDefaultView(ocio_display_); + } + SetupColorProcessor(); update(); }