From: Kostya Shishkov Date: Mon, 15 Jun 2020 12:40:13 +0000 (+0200) Subject: avimux: pad odd frame chunks X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=77d52ff687dc8ebb0a565b3be4777a3adba3b953;p=nihav.git avimux: pad odd frame chunks --- 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<()> {