From: Kostya Shishkov Date: Wed, 8 Feb 2023 16:36:49 +0000 (+0100) Subject: avimux: fix written information for paletted format X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=c905da8d6d7d7f3069f97bf264b32e4366ea964a;p=nihav.git avimux: fix written information for paletted format --- diff --git a/nihav-commonfmt/src/muxers/avi.rs b/nihav-commonfmt/src/muxers/avi.rs index 5e98ed9..0977aac 100644 --- a/nihav-commonfmt/src/muxers/avi.rs +++ b/nihav-commonfmt/src/muxers/avi.rs @@ -172,8 +172,13 @@ impl<'a> MuxCore<'a> for AVIMuxer<'a> { self.bw.write_u32le(0)?; self.bw.write_u32le(vinfo.width as u32)?; self.bw.write_u32le(vinfo.height as u32)?; - self.bw.write_u16le(vinfo.format.components as u16)?; - self.bw.write_u16le(vinfo.format.get_total_depth() as u16)?; + if !vinfo.format.palette { + self.bw.write_u16le(vinfo.format.components as u16)?; + self.bw.write_u16le(vinfo.format.get_total_depth() as u16)?; + } else { + self.bw.write_u16le(1)?; + self.bw.write_u16le(8)?; + } let fcc = find_avi_fourcc(str.get_info().get_name()); if fcc.is_none() { return Err(MuxerError::UnsupportedFormat);