X-Git-Url: https://git.nihav.org/?p=nihav.git;a=blobdiff_plain;f=nihav-ms%2Fsrc%2Fcodecs%2Fmsadpcm.rs;h=a63f4e5a4b9d5661885564d25e5d9ba3199e6f8c;hp=19e8146b00cc21d18f4ac7c7f7ec57f7c7ca0fca;hb=379524159c95f1c3639976ccf35f9d47cd9732ac;hpb=a480a0de101483d802a11e72d758dae00fa4860a diff --git a/nihav-ms/src/codecs/msadpcm.rs b/nihav-ms/src/codecs/msadpcm.rs index 19e8146..a63f4e5 100644 --- a/nihav-ms/src/codecs/msadpcm.rs +++ b/nihav-ms/src/codecs/msadpcm.rs @@ -68,7 +68,7 @@ impl NADecoder for MSADPCMDecoder { self.block_samps = (self.block_len / channels - 7) * 2 + 2; self.ainfo = NAAudioInfo::new(ainfo.get_sample_rate(), channels as u8, SND_S16P_FORMAT, self.block_samps); self.chmap = NAChannelMap::from_str(if channels == 1 { "C" } else { "L,R" }).unwrap(); - self.adapt_coeffs.truncate(0); + self.adapt_coeffs.clear(); if let Some(ref buf) = info.get_extradata() { validate!(buf.len() >= 6); validate!((buf.len() & 3) == 0); @@ -347,7 +347,7 @@ 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 mut stream = NAStream::new(StreamType::Audio, stream_id, info.clone(), self.block_len as u32, ainfo.sample_rate, 0); + let mut stream = NAStream::new(StreamType::Audio, stream_id, info, self.block_len as u32, ainfo.sample_rate, 0); stream.set_num(stream_id as usize); let stream = stream.into_ref(); @@ -464,7 +464,7 @@ mod test { tb_den: 0, flags: 0, }; - test_encoding_md5(&dec_config, &enc_config, enc_params, - &[0xe1591a1e, 0x816d0239, 0x4cc42291, 0x4e6b69cb]); + test_encoding_md5(&dec_config, &enc_config, enc_params, &[], + &[0x82259f45, 0xba7b984a, 0xc03c94e5, 0x00b4312b]); } }