switch NACodecInfo to Arc
[nihav.git] / nihav-rad / src / codecs / binkaud.rs
index ed4c32aa1ecb216cdbdb8375a467a7c1b3f201c5..182c6c91f2a5d7e370f429e6d3dda1d895f58be6 100644 (file)
@@ -178,7 +178,7 @@ const CRITICAL_FREQS: [usize; MAX_BANDS] = [
 const RUN_TAB: [usize; 16] = [ 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 32, 64 ];
 
 impl NADecoder for BinkAudioDecoder {
-    fn init(&mut self, info: Rc<NACodecInfo>) -> DecoderResult<()> {
+    fn init(&mut self, info: NACodecInfoRef) -> DecoderResult<()> {
         if let NACodecTypeInfo::Audio(ainfo) = info.get_properties() {
             let srate    = ainfo.get_sample_rate();
             let channels = ainfo.get_channels();
@@ -238,11 +238,11 @@ impl NADecoder for BinkAudioDecoder {
             let nsamples = br.read(32)? as usize;
 //            validate!(nsamples % self.duration == 0);
 
-            let mut abuf = alloc_audio_buffer(self.ainfo, nsamples / self.chmap.num_channels() / 2, self.chmap.clone())?;
+            let abuf = alloc_audio_buffer(self.ainfo, nsamples / self.chmap.num_channels() / 2, self.chmap.clone())?;
             let mut adata = abuf.get_abuf_f32().unwrap();
             let mut off0 = adata.get_offset(0);
             let mut off1 = adata.get_offset(1);
-            let mut dst = adata.get_data_mut();
+            let dst = adata.get_data_mut().unwrap();
 
             let num_subframes = nsamples / self.duration / self.chmap.num_channels() / 2;