cinepakenc: add missing field in NAVideoInfo used in test
[nihav.git] / nihav-commonfmt / src / codecs / cinepakenc.rs
index f0a28059bcd56e17328dde94c5fd39d3b20715c5..d258df97114c1014eedbe2a4a72894d7cc0f23c9 100644 (file)
@@ -707,10 +707,10 @@ impl CinepakEncoder {
 
             self.render_stripe(true, start_line, end_line);
 
-            if self.v1_idx.len() == 0 {
+            if self.v4_idx.len() == 0 {
                 bw.write_byte(0x32)?;
-                bw.write_u24be((self.v4_idx.len() + 4) as u32)?;
-                bw.write_buf(self.v4_idx.as_slice())?;
+                bw.write_u24be((self.v1_idx.len() + 4) as u32)?;
+                bw.write_buf(self.v1_idx.as_slice())?;
             } else {
                 bw.write_byte(0x30)?;
                 bw.write_u24be(0)?;
@@ -945,7 +945,7 @@ impl NAEncoder for CinepakEncoder {
 
                 let buf = alloc_video_buffer(out_info, 2)?;
                 self.lastfrm = Some(buf.get_vbuf().unwrap());
-                
+
                 Ok(stream)
             },
         }
@@ -1078,6 +1078,7 @@ mod test {
                 height:  0,
                 format:  YUV420_FORMAT,
                 flipped: true,
+                bits:    12,
             };
         let enc_params = EncodeParameters {
                 format:  NACodecTypeInfo::Video(dst_vinfo),