-use std::rc::Rc;
-use std::cell::RefCell;
use nihav_core::formats::*;
use nihav_core::frame::*;
use nihav_core::codecs::*;
struct RA144Decoder {
chmap: NAChannelMap,
ainfo: NAAudioInfo,
- info: Rc<NACodecInfo>,
+ info: NACodecInfoRef,
old_energy: u16,
lpc_data: [[i32; LPC_ORDER]; 2],
}
impl NADecoder for RA144Decoder {
- fn init(&mut self, info: Rc<NACodecInfo>) -> DecoderResult<()> {
+ fn init(&mut self, info: NACodecInfoRef) -> DecoderResult<()> {
if let NACodecTypeInfo::Audio(ainfo) = info.get_properties() {
self.chmap.add_channels(&CHMAP_MONO);
self.ainfo = NAAudioInfo::new(ainfo.get_sample_rate(),
let abuf = alloc_audio_buffer(self.ainfo, duration, self.chmap.clone())?;
let mut adata = abuf.get_abuf_i16().unwrap();
- let mut dst = adata.get_data_mut();
+ let dst = adata.get_data_mut().unwrap();
for (input, output) in pktbuf.chunks(FRAME_SIZE).zip(dst.chunks_mut(NBLOCKS * BLOCKSIZE)) {
let mut br = BitReader::new(input, input.len(), BitReaderMode::BE);