copy encoding parameters from the reference when negotiating the format
[nihav.git] / nihav-ms / src / codecs / msvideo1enc.rs
index 6ddae6485a4ffebafea4328936852994687272c0..f842297d2affedec3405031b90e7b4ac29bc8611 100644 (file)
@@ -410,7 +410,7 @@ impl NAEncoder for MSVideo1Encoder {
             NACodecTypeInfo::Audio(_) => return Err(EncoderError::FormatError),
             NACodecTypeInfo::Video(vinfo) => {
                 let outinfo = NAVideoInfo::new((vinfo.width + 3) & !3, (vinfo.height + 3) & !3, true, RGB555_FORMAT);
-                let mut ofmt = EncodeParameters::default();
+                let mut ofmt = *encinfo;
                 ofmt.format = NACodecTypeInfo::Video(outinfo);
                 Ok(ofmt)
             }