From: Kostya Shishkov Date: Thu, 25 May 2023 15:46:59 +0000 (+0200) Subject: zmbvenc: handle I-frames that turned out to be skip frames X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=252f4009f1e79679923058be5ea7f89cdce4d506;p=nihav.git zmbvenc: handle I-frames that turned out to be skip frames --- diff --git a/nihav-commonfmt/src/codecs/zmbvenc.rs b/nihav-commonfmt/src/codecs/zmbvenc.rs index 52e02e5..d7be605 100644 --- a/nihav-commonfmt/src/codecs/zmbvenc.rs +++ b/nihav-commonfmt/src/codecs/zmbvenc.rs @@ -139,13 +139,14 @@ impl ZMBVEncoder { } } fn encode_intra(&mut self, bw: &mut ByteWriter, buf: NABufferType) -> EncoderResult<()> { - let bpp = buf_type_to_bpp(&buf); + let mut bpp = buf_type_to_bpp(&buf); if let NABufferType::None = buf { if self.bpp == 0 { return Err(EncoderError::FormatError); } self.frm1.copy_from_slice(&self.frm2); + bpp = self.bpp; } else { if bpp == 0 { return Err(EncoderError::FormatError);