X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-ms%2Fsrc%2Fcodecs%2Fmsadpcm.rs;h=d753882b98e7ef98552ec4f19c16d867111c5cbf;hb=c8db9313866c4d7bcf34e45e486d2f909daa16d9;hp=e6e995b6d25465a72478264ff6a580648b58bdd2;hpb=d722ffe95d298490b0ebb3278d6749b7cf59e4fb;p=nihav.git diff --git a/nihav-ms/src/codecs/msadpcm.rs b/nihav-ms/src/codecs/msadpcm.rs index e6e995b..d753882 100644 --- a/nihav-ms/src/codecs/msadpcm.rs +++ b/nihav-ms/src/codecs/msadpcm.rs @@ -3,7 +3,7 @@ use nihav_core::io::byteio::*; use std::str::FromStr; const ADAPT_TABLE: [i32; 16] = [ - 230, 230, 230, 230, 307, 409, 512, 614, + 230, 230, 230, 230, 307, 409, 512, 614, 768, 614, 512, 409, 307, 230, 230, 230 ]; const ADAPT_COEFFS: [[i32; 2]; 7] = [ @@ -346,13 +346,15 @@ 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); self.srate = ainfo.sample_rate; self.flush = false; - + Ok(stream) }, }