switch NACodecInfo to Arc
[nihav.git] / nihav-indeo / src / codecs / indeo4.rs
index 6311dc9975a2584454d949c2225866f11bf6a01b..07f6d67fa9e5faa1d6c8822a55eee3c311770fa8 100644 (file)
@@ -1,5 +1,3 @@
-use std::rc::Rc;
-use std::cell::{Ref, RefCell};
 use nihav_core::io::bitreader::*;
 use nihav_core::formats;
 use nihav_core::frame::*;
@@ -419,7 +417,7 @@ impl IndeoXParser for Indeo4Parser {
 }
 
 struct Indeo4Decoder {
-    info:   Rc<NACodecInfo>,
+    info:   NACodecInfoRef,
     dec:    IVIDecoder,
 }
 
@@ -433,14 +431,14 @@ impl Indeo4Decoder {
 }
 
 impl NADecoder for Indeo4Decoder {
-    fn init(&mut self, info: Rc<NACodecInfo>) -> DecoderResult<()> {
+    fn init(&mut self, info: NACodecInfoRef) -> DecoderResult<()> {
         if let NACodecTypeInfo::Video(vinfo) = info.get_properties() {
             let w = vinfo.get_width();
             let h = vinfo.get_height();
             let f = vinfo.is_flipped();
             let fmt = formats::YUV410_FORMAT;
             let myinfo = NACodecTypeInfo::Video(NAVideoInfo::new(w, h, f, fmt));
-            self.info = Rc::new(NACodecInfo::new_ref(info.get_name(), myinfo, info.get_extradata()));
+            self.info = NACodecInfo::new_ref(info.get_name(), myinfo, info.get_extradata()).into_ref();
             Ok(())
         } else {
             Err(DecoderError::InvalidData)