diff --git a/app/streaming/video/ffmpeg-renderers/plvk.cpp b/app/streaming/video/ffmpeg-renderers/plvk.cpp index c4719fa5..fddede67 100644 --- a/app/streaming/video/ffmpeg-renderers/plvk.cpp +++ b/app/streaming/video/ffmpeg-renderers/plvk.cpp @@ -897,7 +897,19 @@ void PlVkRenderer::renderFrame(AVFrame *frame) if (!pl_color_space_equal(&mappedFrame.color, &m_LastColorspace)) { m_LastColorspace = mappedFrame.color; SDL_assert(pl_color_space_equal(&mappedFrame.color, &m_LastColorspace)); - pl_swapchain_colorspace_hint(m_Swapchain, &mappedFrame.color); + +#ifdef Q_OS_DARWIN + // There is a gamma mismatch on macOS between what libplacebo thinks BT.709 + // should use and what the Metal layer actually displays. Use sRGB for the + // swapchain when the incoming frames are BT.709 as a workaround. + if (pl_color_space_equal(&mappedFrame.color, &pl_color_space_bt709)) { + pl_swapchain_colorspace_hint(m_Swapchain, &pl_color_space_srgb); + } + else +#endif + { + pl_swapchain_colorspace_hint(m_Swapchain, &mappedFrame.color); + } } // Reserve enough space to avoid allocating under the overlay lock