switch NACodecInfo to Arc
[nihav.git] / nihav-indeo / src / codecs / imc.rs
index 53ea68600133443ab7a078231ae3d9b0c101fbb7..ceac0d1062e33de26dbeb77b7bab7fc33b73d9e2 100644 (file)
@@ -1,8 +1,6 @@
 use std::mem;
 use std::ptr;
 use std::f32::consts;
-use std::rc::Rc;
-use std::cell::RefCell;
 
 use nihav_core::formats::*;
 use nihav_core::frame::*;
@@ -323,7 +321,7 @@ struct IMCDecoder {
 
     chmap:  NAChannelMap,
     ainfo:  NAAudioInfo,
-    info:   Rc<NACodecInfo>,
+    info:   NACodecInfoRef,
 
     codes:  [[Codebook<u8>; 4]; 4],
     ch_data: [IMCChannel; 2],
@@ -867,7 +865,7 @@ const CHMAP_MONO: [NAChannelType; 1] = [NAChannelType::C];
 const CHMAP_STEREO: [NAChannelType; 2] = [NAChannelType::L, NAChannelType::R];
 
 impl NADecoder for IMCDecoder {
-    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 = NAChannelMap::new();
             match ainfo.get_channels() {
@@ -898,7 +896,7 @@ impl NADecoder for IMCDecoder {
 
         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 mut start: usize = 0;
         let channels = self.ainfo.get_channels() as usize;