fix colorspace filter for some files with invalid color metadata (#1254)
This commit is contained in:
@@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- Maintain watermark alpha channel (built-in transparency) using QSV acceleration
|
||||
- Properly extract and burn in embedded text subtitles using Jellyfin, Emby and Plex libraries
|
||||
- Fix bug where deleting a channel would not remove its data from XMLTV
|
||||
- Fix colorspace filter for some files with invalid color metadata
|
||||
|
||||
### Changed
|
||||
- Remove duplicate items from smart collections before scheduling
|
||||
|
||||
@@ -10,14 +10,14 @@ public record MediaItemInfoStream(
|
||||
string Profile,
|
||||
string Language,
|
||||
int? Channels,
|
||||
bool Default,
|
||||
bool Forced,
|
||||
bool AttachedPic,
|
||||
bool? Default,
|
||||
bool? Forced,
|
||||
bool? AttachedPic,
|
||||
string PixelFormat,
|
||||
string ColorRange,
|
||||
string ColorSpace,
|
||||
string ColorTransfer,
|
||||
string ColorPrimaries,
|
||||
int BitsPerRawSample,
|
||||
int? BitsPerRawSample,
|
||||
string FileName,
|
||||
string MimeType);
|
||||
|
||||
@@ -83,15 +83,15 @@ public class GetMediaItemInfoHandler : IRequestHandler<GetMediaItemInfo, Either<
|
||||
mediaStream.Profile,
|
||||
mediaStream.Language,
|
||||
mediaStream.Channels > 0 ? mediaStream.Channels : null,
|
||||
mediaStream.Default,
|
||||
mediaStream.Forced,
|
||||
mediaStream.AttachedPic,
|
||||
mediaStream.Default ? true : null,
|
||||
mediaStream.Forced ? true : null,
|
||||
mediaStream.AttachedPic ? true : null,
|
||||
mediaStream.PixelFormat,
|
||||
mediaStream.ColorRange,
|
||||
mediaStream.ColorSpace,
|
||||
mediaStream.ColorTransfer,
|
||||
mediaStream.ColorPrimaries,
|
||||
mediaStream.BitsPerRawSample,
|
||||
mediaStream.BitsPerRawSample > 0 ? mediaStream.BitsPerRawSample : null,
|
||||
mediaStream.FileName,
|
||||
mediaStream.MimeType);
|
||||
}
|
||||
|
||||
@@ -82,13 +82,16 @@ public class ColorspaceFilter : BaseFilter
|
||||
if (cp.IsMixed || _forceInputOverrides)
|
||||
{
|
||||
string range = string.IsNullOrWhiteSpace(cp.ColorRange) ? "tv" : cp.ColorRange;
|
||||
string transfer = string.IsNullOrWhiteSpace(cp.ColorTransfer)
|
||||
|
||||
string transfer = string.IsNullOrWhiteSpace(cp.ColorTransfer) || string.Equals(cp.ColorTransfer, "reserved", StringComparison.OrdinalIgnoreCase)
|
||||
? "bt709"
|
||||
: cp.ColorTransfer;
|
||||
string primaries = string.IsNullOrWhiteSpace(cp.ColorPrimaries)
|
||||
|
||||
string primaries = string.IsNullOrWhiteSpace(cp.ColorPrimaries) || string.Equals(cp.ColorPrimaries, "reserved", StringComparison.OrdinalIgnoreCase)
|
||||
? "bt709"
|
||||
: cp.ColorPrimaries;
|
||||
string space = string.IsNullOrWhiteSpace(cp.ColorSpace)
|
||||
|
||||
string space = string.IsNullOrWhiteSpace(cp.ColorSpace) || string.Equals(cp.ColorSpace, "reserved", StringComparison.OrdinalIgnoreCase)
|
||||
? "bt709"
|
||||
: cp.ColorSpace;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user