switch NACodecInfo to Arc
[nihav.git] / nihav-realmedia / src / codecs / rv10.rs
index 348a7ff8b713c80255593e9dc9571bb830344135..1d93a012433a54cb12f2a446e9bb1de005926231 100644 (file)
@@ -1,5 +1,3 @@
-use std::rc::Rc;
-use std::cell::RefCell;
 use nihav_core::io::bitreader::*;
 use nihav_core::io::codebook::*;
 use nihav_core::formats;
@@ -23,7 +21,7 @@ struct Tables {
 }
 
 struct RealVideo10Decoder {
-    info:    Rc<NACodecInfo>,
+    info:    NACodecInfoRef,
     dec:     H263BaseDecoder,
     tables:  Tables,
     w:       usize,
@@ -392,7 +390,7 @@ impl RealVideo10Decoder {
         };
 
         RealVideo10Decoder{
-            info:           Rc::new(DUMMY_CODEC_INFO),
+            info:           NACodecInfoRef::default(),
             dec:            H263BaseDecoder::new_with_opts(false, false, false),
             tables:         tables,
             w:              0,
@@ -405,13 +403,13 @@ impl RealVideo10Decoder {
 }
 
 impl NADecoder for RealVideo10Decoder {
-    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 fmt = formats::YUV420_FORMAT;
             let myinfo = NACodecTypeInfo::Video(NAVideoInfo::new(w, h, false, 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();
             self.w = w;
             self.h = h;