aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2020-06-05 18:42:02 +0200
committerKostya Shishkov <kostya.shishkov@gmail.com>2020-06-05 18:42:02 +0200
commit2ff5620166d8ce8b838b251d1fdd8de73f3f857c (patch)
tree081f0670c1535790f29b420780ae36a6db6c8475
parent3c406629cabc3b77f9198646b0f93fc7e486e277 (diff)
downloadnihav-2ff5620166d8ce8b838b251d1fdd8de73f3f857c.tar.gz
set stream number in encoders too
-rw-r--r--nihav-commonfmt/src/codecs/cinepakenc.rs4
-rw-r--r--nihav-ms/src/codecs/msadpcm.rs4
-rw-r--r--nihav-ms/src/codecs/msvideo1enc.rs4
3 files changed, 9 insertions, 3 deletions
diff --git a/nihav-commonfmt/src/codecs/cinepakenc.rs b/nihav-commonfmt/src/codecs/cinepakenc.rs
index 645bd83..4271e1a 100644
--- a/nihav-commonfmt/src/codecs/cinepakenc.rs
+++ b/nihav-commonfmt/src/codecs/cinepakenc.rs
@@ -929,7 +929,9 @@ impl NAEncoder for CinepakEncoder {
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;
diff --git a/nihav-ms/src/codecs/msadpcm.rs b/nihav-ms/src/codecs/msadpcm.rs
index e6e995b..d47d922 100644
--- a/nihav-ms/src/codecs/msadpcm.rs
+++ b/nihav-ms/src/codecs/msadpcm.rs
@@ -346,7 +346,9 @@ impl NAEncoder for MSADPCMEncoder {
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);
diff --git a/nihav-ms/src/codecs/msvideo1enc.rs b/nihav-ms/src/codecs/msvideo1enc.rs
index f842297..41d5ff7 100644
--- a/nihav-ms/src/codecs/msvideo1enc.rs
+++ b/nihav-ms/src/codecs/msvideo1enc.rs
@@ -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);
}