diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2023-02-08 17:36:49 +0100 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2023-02-08 17:36:49 +0100 |
commit | c905da8d6d7d7f3069f97bf264b32e4366ea964a (patch) | |
tree | 16b713d2799968c533ff42724e7c1a221f362723 | |
parent | adfa9ca494e9b28ada50cb42738a3bee2d11e75d (diff) | |
download | nihav-c905da8d6d7d7f3069f97bf264b32e4366ea964a.tar.gz |
avimux: fix written information for paletted format
-rw-r--r-- | nihav-commonfmt/src/muxers/avi.rs | 9 |
1 files changed, 7 insertions, 2 deletions
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); |