Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Commit

Permalink
HDR: Fix #15
Browse files Browse the repository at this point in the history
  • Loading branch information
CarterLi committed Apr 24, 2022
1 parent edcd204 commit bd455c1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions iina/VideoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class VideoView: NSView {

var pendingRedrawAfterEnteringPIP = false;

lazy var hdrSubsystem = Logger.Subsystem(rawValue: "hdr")

// MARK: - Attributes

override var mouseDownCanMoveWindow: Bool {
Expand Down Expand Up @@ -302,7 +304,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;
}

Expand Down Expand Up @@ -358,13 +360,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, "")
Expand Down

0 comments on commit bd455c1

Please sign in to comment.