From 252f4009f1e79679923058be5ea7f89cdce4d506 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Thu, 25 May 2023 17:46:59 +0200 Subject: [PATCH] zmbvenc: handle I-frames that turned out to be skip frames --- nihav-commonfmt/src/codecs/zmbvenc.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.39.5