]> git.nihav.org Git - nihav.git/commitdiff
fix HAM shuffler
authorKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 20 May 2017 15:03:10 +0000 (17:03 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 20 May 2017 15:03:10 +0000 (17:03 +0200)
src/codecs/mod.rs

index 426cb049f9dffea322999b8b66265594403cf13e..75f07c1b6bdcb816a125c2a46d3447952971cb51 100644 (file)
@@ -53,10 +53,12 @@ impl HAMShuffler {
     }
     #[allow(dead_code)]
     fn clone_ref(&mut self) -> Option<NAFrameRef> {
-        match self.lastframe {
-            Some(ref frm) => Some(Rc::new(RefCell::new(NAFrame::from_copy(&frm.borrow())))),
-            None => None,
-        }
+        if let None = self.lastframe { return None; }
+        if let Some(ref mut frm) = self.lastframe {
+            let newfrm = Rc::new(RefCell::new(NAFrame::from_copy(&frm.borrow())));
+            *frm = newfrm.clone();
+            Some(newfrm)
+        } else { None }
     }
     #[allow(dead_code)]
     fn get_output_frame(&mut self) -> Option<NAFrameRef> {