From 77d52ff687dc8ebb0a565b3be4777a3adba3b953 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Mon, 15 Jun 2020 14:40:13 +0200 Subject: [PATCH] avimux: pad odd frame chunks --- nihav-commonfmt/src/muxers/avi.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nihav-commonfmt/src/muxers/avi.rs b/nihav-commonfmt/src/muxers/avi.rs index 2583109..2f8e229 100644 --- a/nihav-commonfmt/src/muxers/avi.rs +++ b/nihav-commonfmt/src/muxers/avi.rs @@ -253,6 +253,9 @@ impl<'a> MuxCore<'a> for AVIMuxer<'a> { write_chunk_hdr(&mut self.bw, str.get_media_type(), str_num as u32)?; self.bw.write_u32le(chunk_len)?; self.bw.write_buf(pkt.get_buffer().as_slice())?; + if (self.bw.tell() & 1) != 0 { + self.bw.write_byte(0)?; + } Ok(()) } fn flush(&mut self) -> MuxerResult<()> { -- 2.39.5