X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-commonfmt%2Fsrc%2Fcodecs%2Fcinepakenc.rs;h=c6af8f61cdd9f71e55ef72a0e1cedf215d10ebc1;hb=405cec9eed5d7f58440ec8495f5cbc1f5c6fee40;hp=3269cf8ea7ef7de5fb111cdc5bce516b36306acc;hpb=886cde4847280b96e10d240c2f2d76abec121dc8;p=nihav.git diff --git a/nihav-commonfmt/src/codecs/cinepakenc.rs b/nihav-commonfmt/src/codecs/cinepakenc.rs index 3269cf8..c6af8f6 100644 --- a/nihav-commonfmt/src/codecs/cinepakenc.rs +++ b/nihav-commonfmt/src/codecs/cinepakenc.rs @@ -925,9 +925,10 @@ impl NAEncoder for CinepakEncoder { fn negotiate_format(&self, encinfo: &EncodeParameters) -> EncoderResult { match encinfo.format { NACodecTypeInfo::None => { - let mut ofmt = EncodeParameters::default(); - ofmt.format = NACodecTypeInfo::Video(NAVideoInfo::new(0, 0, true, YUV420_FORMAT)); - Ok(ofmt) + Ok(EncodeParameters { + format: NACodecTypeInfo::Video(NAVideoInfo::new(0, 0, true, YUV420_FORMAT)), + ..Default::default() + }) }, NACodecTypeInfo::Audio(_) => Err(EncoderError::FormatError), NACodecTypeInfo::Video(vinfo) => { @@ -1052,8 +1053,8 @@ impl NAOptionHandler for CinepakEncoder { } }, "quant_mode" => { - if let NAValue::String(ref str) = option.value { - match str.as_str() { + if let NAValue::String(ref strval) = option.value { + match strval.as_str() { "elbg" => self.qmode = QuantMode::ELBG, "hybrid" => self.qmode = QuantMode::Hybrid, "mediancut" => self.qmode = QuantMode::MedianCut,