From 79e6eb2bfe614f74ec2c1d77a1f59ecd43f480cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 5 Jan 2022 10:25:43 +0800 Subject: [PATCH] HDR: Fix https://github.com/iina-plus/iina/issues/15 --- iina/VideoView.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/iina/VideoView.swift b/iina/VideoView.swift index 4284c5068a..1b5ae4d63d 100644 --- a/iina/VideoView.swift +++ b/iina/VideoView.swift @@ -40,6 +40,8 @@ class VideoView: NSView { var pendingRedrawAfterEnteringPIP = false; + lazy var hdrSubsystem = Logger.Subsystem(rawValue: "hdr") + // MARK: - Attributes override var mouseDownCanMoveWindow: Bool { @@ -287,7 +289,7 @@ extension VideoView { guard mpv.getDouble(MPVProperty.videoParamsSigPeak) > 1.0 else { return false } // SDR content guard (window?.screen?.maximumPotentialExtendedDynamicRangeColorComponentValue ?? 1.0) > 1.0 else { - Logger.log("HDR: HDR video was found but the display does not support EDR mode"); + Logger.log("HDR video was found but the display does not support EDR mode", level: .debug, subsystem: hdrSubsystem); return false; } @@ -343,13 +345,13 @@ extension VideoView { } default: - Logger.log("HDR: Unknown HDR color space information gamma=\(gamma) primaries=\(primaries)"); + Logger.log("Unknown HDR color space information gamma=\(gamma) primaries=\(primaries)", level: .debug, subsystem: hdrSubsystem); return false; } if (!player.info.hdrEnabled) { return nil } - Logger.log("HDR: Will activate HDR color space instead of using ICC profile"); + Logger.log("Will activate HDR color space instead of using ICC profile", level: .debug, subsystem: hdrSubsystem); videoLayer.colorspace = CGColorSpace(name: name!) player.mpv.setString(MPVOption.GPURendererOptions.iccProfile, "")