switch NACodecInfo to Arc
[nihav.git] / nihav-commonfmt / src / codecs / aac.rs
index 02223c8a969fa0a5aeebb976b346a44ab87a1663..412bc9c8b4c0883403ba31ba897dfd053334b317 100644 (file)
@@ -1,5 +1,3 @@
-use std::rc::Rc;
-use std::cell::RefCell;
 use nihav_core::formats::*;
 use nihav_core::frame::*;
 use nihav_core::codecs::*;
@@ -966,7 +964,7 @@ impl ChannelPair {
     }
     fn synth_audio(&mut self, dsp: &mut DSP, abuf: &mut NABufferType, srate_idx: usize) {
         let mut adata = abuf.get_abuf_f32().unwrap();
-        let mut output = adata.get_data_mut();
+        let output = adata.get_data_mut().unwrap();
         let off0 = abuf.get_offset(self.channel);
         let off1 = abuf.get_offset(self.channel + 1);
         self.ics[0].synth_channel(dsp, &mut output[off0..], srate_idx);
@@ -1107,7 +1105,7 @@ impl DSP {
 }
 
 struct AACDecoder {
-    info:       Rc<NACodecInfo>,
+    info:       NACodecInfoRef,
     chmap:      NAChannelMap,
     m4ainfo:    M4AInfo,
     pairs:      Vec<ChannelPair>,
@@ -1205,7 +1203,7 @@ impl AACDecoder {
 }
 
 impl NADecoder for AACDecoder {
-    fn init(&mut self, info: Rc<NACodecInfo>) -> DecoderResult<()> {
+    fn init(&mut self, info: NACodecInfoRef) -> DecoderResult<()> {
         if let NACodecTypeInfo::Audio(_) = info.get_properties() {
             let edata = info.get_extradata().unwrap();
             validate!(edata.len() >= 2);