]> git.nihav.org Git - nihav.git/commitdiff
indeo3enc: fix handling of skipped frame
authorKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 24 Feb 2026 17:28:30 +0000 (18:28 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 24 Feb 2026 17:28:30 +0000 (18:28 +0100)
Previously it forgot to _not_ update buffer reference, leadring
to decoders reading from the wrong previous frame.

nihav-indeo/src/codecs/indeo3enc/mod.rs

index 2df61c761d9f529c97e2c9b80ebfa2263ba7a3f3..f2269a24745fb6b2c18c63cdc571563accbc6252 100644 (file)
@@ -387,7 +387,12 @@ impl NAEncoder for Indeo3Encoder {
                 }
             }
 
-            std::mem::swap(&mut self.cframe, &mut self.pframe);
+            if !skipped {
+                std::mem::swap(&mut self.cframe, &mut self.pframe);
+            } else {
+                self.buf_sel = !self.buf_sel;
+                dbuf[19] ^= 1;
+            }
             self.frameno += 1;
 
             let fsize = dbuf.len() as u32;