From 3bd541c8c36c8ea8fcabbccf5d6bd99d850d3164 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sat, 20 May 2017 17:03:10 +0200 Subject: [PATCH] fix HAM shuffler --- src/codecs/mod.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/codecs/mod.rs b/src/codecs/mod.rs index 426cb04..75f07c1 100644 --- a/src/codecs/mod.rs +++ b/src/codecs/mod.rs @@ -53,10 +53,12 @@ impl HAMShuffler { } #[allow(dead_code)] fn clone_ref(&mut self) -> Option { - 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 { -- 2.39.5