X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-ms%2Fsrc%2Fcodecs%2Fimaadpcmenc.rs;h=15e76fb251a7473bcff2b1ca80fb0a4c3a58e234;hb=c5963b17d4007f5995e14a9e400475cdb47fd81f;hp=a64f58f0dbac96282d6208516bcf3f53837552de;hpb=c7cd83f3edfc537ae8c2dc913e2dd1b62a449734;p=nihav.git diff --git a/nihav-ms/src/codecs/imaadpcmenc.rs b/nihav-ms/src/codecs/imaadpcmenc.rs index a64f58f..15e76fb 100644 --- a/nihav-ms/src/codecs/imaadpcmenc.rs +++ b/nihav-ms/src/codecs/imaadpcmenc.rs @@ -189,9 +189,9 @@ impl NAEncoder for IMAADPCMEncoder { fn negotiate_format(&self, encinfo: &EncodeParameters) -> EncoderResult { match encinfo.format { NACodecTypeInfo::None => { - let mut ofmt = EncodeParameters::default(); - ofmt.format = NACodecTypeInfo::Audio(NAAudioInfo::new(0, 1, SND_S16_FORMAT, DEFAULT_BLOCK_LEN)); - Ok(ofmt) + Ok(EncodeParameters { + format: NACodecTypeInfo::Audio(NAAudioInfo::new(0, 1, SND_S16_FORMAT, DEFAULT_BLOCK_LEN)), + ..Default::default() }) }, NACodecTypeInfo::Video(_) => Err(EncoderError::FormatError), NACodecTypeInfo::Audio(ainfo) => { @@ -341,6 +341,7 @@ mod test { let mut enc_reg = RegisteredEncoders::new(); ms_register_all_encoders(&mut enc_reg); + // sample: https://samples.mplayerhq.hu/V-codecs/VP4/ot171_vp40.avi let dec_config = DecoderTestParams { demuxer: "avi", in_name: "assets/Duck/ot171_vp40.avi", @@ -371,7 +372,7 @@ mod test { let enc_options = &[ NAOption{name: "trellis", value: NAValue::Bool(trellis)}, ]; - test_encoding_to_file(&dec_config, &enc_config, enc_params, enc_options); +// test_encoding_to_file(&dec_config, &enc_config, enc_params, enc_options); test_encoding_md5(&dec_config, &enc_config, enc_params, enc_options, hash);