From f16077ca87e96c7e93121651847ec40823c175b8 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Fri, 27 Nov 2026 17:10:54 +0100 Subject: [PATCH] support Flic in MOV --- nihav-commonfmt/src/demuxers/mov/track.rs | 5 ++++- nihav-registry/src/register.rs | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/nihav-commonfmt/src/demuxers/mov/track.rs b/nihav-commonfmt/src/demuxers/mov/track.rs index 9ebcb3a..92e937c 100644 --- a/nihav-commonfmt/src/demuxers/mov/track.rs +++ b/nihav-commonfmt/src/demuxers/mov/track.rs @@ -356,9 +356,12 @@ fn read_stsd(track: &mut Track, br: &mut dyn ByteIO, size: u64) -> DemuxerResult let depth = br.read_u16be()?; let ctable_id = br.read_u16be()?; let grayscale = depth > 0x20 || depth == 1; - let depth = if grayscale { depth & 0x1F } else { depth }; + let mut depth = if grayscale { depth & 0x1F } else { depth }; if ctable_id == 0 { let max_pal_size = start_pos + size - br.tell(); + if depth == 24 && max_pal_size > 16 && &fcc == b"flic" { + depth = 8; + } if depth <= 8 { let mut pal = [0; 1024]; read_palette(br, max_pal_size, &mut pal)?; diff --git a/nihav-registry/src/register.rs b/nihav-registry/src/register.rs index ef3f542..d98141e 100644 --- a/nihav-registry/src/register.rs +++ b/nihav-registry/src/register.rs @@ -483,6 +483,7 @@ static MOV_VIDEO_CODEC_REGISTER: &[(&[u8;4], &str)] = &[ (b"SVQ3", "sorenson-video3"), (b"svq3", "sorenson-video3"), (b"gif ", "qt-gif"), + (b"flic", "flic"), (b"msvc", "msvideo1"), -- 2.47.3