copy encoding parameters from the reference when negotiating the format
[nihav.git] / nihav-ms / src / codecs / msadpcm.rs
index d906e4ca89e98bd2cce7c83906565c59391503e5..e6e995b6d25465a72478264ff6a580648b58bdd2 100644 (file)
@@ -161,6 +161,12 @@ impl NADecoder for MSADPCMDecoder {
     }
 }
 
+impl NAOptionHandler for MSADPCMDecoder {
+    fn get_supported_options(&self) -> &[NAOptionDefinition] { &[] }
+    fn set_options(&mut self, _options: &[NAOption]) { }
+    fn query_option_value(&self, _name: &str) -> Option<NAValue> { None }
+}
+
 pub fn get_decoder() -> Box<dyn NADecoder + Send> {
     Box::new(MSADPCMDecoder::new())
 }
@@ -314,7 +320,7 @@ impl NAEncoder for MSADPCMEncoder {
                 if (outinfo.channels == 1) && ((outinfo.block_len & 1) == 1) {
                     outinfo.block_len += 1;
                 }
-                let mut ofmt = EncodeParameters::default();
+                let mut ofmt = *encinfo;
                 ofmt.format = NACodecTypeInfo::Audio(outinfo);
                 return Ok(ofmt);
             }