From bc6aac3dfdc4b4161f9b7284b058a752bd78c4b4 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sun, 28 May 2017 11:41:20 +0200 Subject: [PATCH] add skip frames and paletted alloc --- src/frame.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/frame.rs b/src/frame.rs index 97b0a50..02bdf33 100644 --- a/src/frame.rs +++ b/src/frame.rs @@ -250,7 +250,20 @@ pub fn alloc_video_buffer(vinfo: NAVideoInfo, align: u8) -> Result = Vec::with_capacity(new_size.unwrap()); + data.resize(new_size.unwrap(), 0); + let buf: NAVideoBuffer = NAVideoBuffer { data: Rc::new(RefCell::new(data)), info: vinfo, offs: offs }; + Ok(NABufferType::Video(buf)) + } else if !all_packed { for i in 0..fmt.get_num_comp() { let chr = fmt.get_chromaton(i).unwrap(); if !vinfo.is_flipped() { @@ -412,6 +425,7 @@ pub enum FrameType { I, P, B, + Skip, Other, } @@ -421,6 +435,7 @@ impl fmt::Display for FrameType { FrameType::I => write!(f, "I"), FrameType::P => write!(f, "P"), FrameType::B => write!(f, "B"), + FrameType::Skip => write!(f, "skip"), FrameType::Other => write!(f, "x"), } } -- 2.39.5