From d3f88b4987730e396bc41c2674edddb53845cb37 Mon Sep 17 00:00:00 2001 From: Zaggy1024 Date: Thu, 20 Jun 2024 21:47:44 -0500 Subject: [PATCH] LibMedia/Matroska: Actually read out the video color range Apparently I forgot to put read the value for this field, though this generally doesn't matter since video bitstreams usually specify CICP as well. --- Userland/Libraries/LibMedia/Containers/Matroska/Reader.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Userland/Libraries/LibMedia/Containers/Matroska/Reader.cpp b/Userland/Libraries/LibMedia/Containers/Matroska/Reader.cpp index 036223b4be2..6903ad69bbb 100644 --- a/Userland/Libraries/LibMedia/Containers/Matroska/Reader.cpp +++ b/Userland/Libraries/LibMedia/Containers/Matroska/Reader.cpp @@ -62,6 +62,7 @@ constexpr u32 COLOR_ENTRY_ID = 0x55B0; constexpr u32 PRIMARIES_ID = 0x55BB; constexpr u32 TRANSFER_CHARACTERISTICS_ID = 0x55BA; constexpr u32 MATRIX_COEFFICIENTS_ID = 0x55B1; +constexpr u32 RANGE_ID = 0x55B9; constexpr u32 BITS_PER_CHANNEL_ID = 0x55B2; // Audio @@ -385,6 +386,10 @@ static DecoderErrorOr parse_video_color_information(Str color_format.matrix_coefficients = static_cast(TRY_READ(streamer.read_u64())); dbgln_if(MATROSKA_TRACE_DEBUG, "Read Colour's MatrixCoefficients attribute: {}", matrix_coefficients_to_string(color_format.matrix_coefficients)); break; + case RANGE_ID: + color_format.range = static_cast(TRY_READ(streamer.read_u64())); + dbgln_if(MATROSKA_TRACE_DEBUG, "Read Colour's Range attribute: {}", to_underlying(color_format.range)); + break; case BITS_PER_CHANNEL_ID: color_format.bits_per_channel = TRY_READ(streamer.read_u64()); dbgln_if(MATROSKA_TRACE_DEBUG, "Read Colour's BitsPerChannel attribute: {}", color_format.bits_per_channel);