-use std::rc::Rc;
-use std::cell::RefCell;
use nihav_core::formats::*;
use nihav_core::frame::*;
use nihav_core::codecs::*;
struct SiproDecoder {
chmap: NAChannelMap,
ainfo: NAAudioInfo,
- info: Rc<NACodecInfo>,
+ info: NACodecInfoRef,
mode: &'static SiproModeInfo,
mode_type: SiproMode,
const CHMAP_MONO: [NAChannelType; 1] = [NAChannelType::C];
impl NADecoder for SiproDecoder {
- fn init(&mut self, info: Rc<NACodecInfo>) -> DecoderResult<()> {
+ fn init(&mut self, info: NACodecInfoRef) -> DecoderResult<()> {
if let NACodecTypeInfo::Audio(ainfo) = info.get_properties() {
let mut found = false;
for i in 0..SIPRO_MODES.len() {
let duration = out_frm_size * nframes;
- let mut abuf = alloc_audio_buffer(self.ainfo, duration, self.chmap.clone())?;
+ let abuf = alloc_audio_buffer(self.ainfo, duration, self.chmap.clone())?;
let mut adata = abuf.get_abuf_f32().unwrap();
- let mut dst = adata.get_data_mut();
+ let dst = adata.get_data_mut().unwrap();
let frame_len = self.mode.subframe_len * self.mode.subframes;
for (input, output) in pktbuf.chunks(frm_size).zip(dst.chunks_mut(out_frm_size)) {