]> git.nihav.org Git - nihav.git/blobdiff - nihav-ms/src/codecs/msvideo1enc.rs
set stream number in encoders too
[nihav.git] / nihav-ms / src / codecs / msvideo1enc.rs
index 6ddae6485a4ffebafea4328936852994687272c0..41d5ff7168127b2ed229316a9cdfae3e52ac10cd 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)
             }
@@ -430,7 +430,9 @@ impl NAEncoder for MSVideo1Encoder {
 
                 let out_info = NAVideoInfo::new(vinfo.width, vinfo.height, true, RGB555_FORMAT);
                 let info = NACodecInfo::new("msvideo1", NACodecTypeInfo::Video(out_info.clone()), None);
-                let stream = NAStream::new(StreamType::Video, stream_id, info, encinfo.tb_num, encinfo.tb_den).into_ref();
+                let mut stream = NAStream::new(StreamType::Video, stream_id, info, encinfo.tb_num, encinfo.tb_den);
+                stream.set_num(stream_id as usize);
+                let stream = stream.into_ref();
                 if let Err(_) = self.pool.prealloc_video(out_info, 2) {
                     return Err(EncoderError::AllocError);
                 }