#[cfg(feature="decoder_pcm")]
fn get_duration(ainfo: &NAAudioInfo, duration: Option<u64>, data_size: usize) -> u64 {
- if duration == None {
+ if let Some(dur) = duration {
+ dur
+ } else {
let size_bits = (data_size as u64) * 8;
let blk_size = u64::from(ainfo.get_channels()) * u64::from(ainfo.get_format().get_bits());
size_bits / blk_size
- } else {
- duration.unwrap()
}
}
}
}
}
+ fn get_capabilities(&self) -> u64 { ENC_CAPS_CBR }
fn init(&mut self, stream_id: u32, encinfo: EncodeParameters) -> EncoderResult<NAStreamRef> {
match encinfo.format {
NACodecTypeInfo::None => Err(EncoderError::FormatError),