From 32edf77d352a1ce495e2e266c634c0868ee0ce1f Mon Sep 17 00:00:00 2001 From: Jason Dove Date: Fri, 25 Nov 2022 10:09:58 -0600 Subject: [PATCH] fix bt709 check (#1039) --- ErsatzTV.FFmpeg/ColorParams.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ErsatzTV.FFmpeg/ColorParams.cs b/ErsatzTV.FFmpeg/ColorParams.cs index 4d0e6de83..bdcda80a2 100644 --- a/ErsatzTV.FFmpeg/ColorParams.cs +++ b/ErsatzTV.FFmpeg/ColorParams.cs @@ -10,5 +10,19 @@ public record ColorParams(string ColorRange, string ColorSpace, string ColorTran string.IsNullOrWhiteSpace(ColorTransfer) && string.IsNullOrWhiteSpace(ColorPrimaries); - public bool IsBt709 => this == Default; + public bool IsBt709 + { + get + { + if (this == Default) + { + return true; + } + + // some sources don't set transfer and primaries metadata + return ColorRange == "tv" && ColorSpace == "bt709" + && string.IsNullOrWhiteSpace(ColorTransfer) + && string.IsNullOrWhiteSpace(ColorPrimaries); + } + } }