let out_info = NAVideoInfo::new(vinfo.width, vinfo.height, false, vinfo.format);
let info = NACodecInfo::new("cinepak", 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();
self.stream = Some(stream.clone());
self.quality = encinfo.quality;
let soniton = NASoniton::new(4, 0);
let out_ainfo = NAAudioInfo::new(ainfo.sample_rate, ainfo.channels, soniton, Self::calc_block_size(self.block_len, self.channels));
let info = NACodecInfo::new("ms-adpcm", NACodecTypeInfo::Audio(out_ainfo), None);
- let stream = NAStream::new(StreamType::Audio, stream_id, info.clone(), self.block_len as u32, ainfo.sample_rate).into_ref();
+ let mut stream = NAStream::new(StreamType::Audio, stream_id, info.clone(), self.block_len as u32, ainfo.sample_rate);
+ stream.set_num(stream_id as usize);
+ let stream = stream.into_ref();
self.stream = Some(stream.clone());
self.samples = Vec::with_capacity(self.block_len * self.channels);
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);
}