switch NACodecInfo to Arc
[nihav.git] / nihav-realmedia / src / codecs / ralf.rs
index e114dd0ea67cbe9fb16e60391520eadcc3556bff..307436c9ed03743a7158a5f88761c28383e7cba7 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::*;
@@ -246,7 +244,7 @@ struct Block {
 
 const RALF_MAX_PACKET_SIZE: usize = 8192;
 struct RALFDecoder {
-    info:           Rc<NACodecInfo>,
+    info:           NACodecInfoRef,
     chmap:          NAChannelMap,
     channels:       u8,
 
@@ -303,7 +301,7 @@ impl RALFDecoder {
         let ch0 = abuf.get_offset(0) + self.sample_offset;
         let ch1 = abuf.get_offset(1) + self.sample_offset;
         let mut adata = abuf.get_abuf_i16().unwrap();
-        let mut output = adata.get_data_mut();
+        let output = adata.get_data_mut().unwrap();
         match dmode {
             0 => {
                     for i in 0..length {
@@ -357,7 +355,7 @@ fn read_block_length(br: &mut BitReader) -> DecoderResult<usize> {
 }
 
 impl NADecoder for RALFDecoder {
-    fn init(&mut self, info: Rc<NACodecInfo>) -> DecoderResult<()> {
+    fn init(&mut self, info: NACodecInfoRef) -> DecoderResult<()> {
         if let NACodecTypeInfo::Audio(ainfo) = info.get_properties() {
             let edata = info.get_extradata().unwrap();