Commit f1c43dbd authored by Thomas Daede's avatar Thomas Daede

Reuse code for first keyframe and all other keyframes.

parent c83f7cc7
...@@ -713,21 +713,19 @@ impl<T: Pixel> ContextInner<T> { ...@@ -713,21 +713,19 @@ impl<T: Pixel> ContextInner<T> {
} }
fn build_frame_properties(&mut self, idx: u64) -> Result<(FrameInvariants<T>, bool), EncoderStatus> { fn build_frame_properties(&mut self, idx: u64) -> Result<(FrameInvariants<T>, bool), EncoderStatus> {
if idx == 0 { let mut fi = if idx == 0 {
let seq = Sequence::new(&self.config); let seq = Sequence::new(&self.config);
// The first frame will always be a key frame // The first frame will always be a key frame
let fi = FrameInvariants::new_key_frame( FrameInvariants::new_key_frame(
&FrameInvariants::new( &FrameInvariants::new(
self.config.clone(), self.config.clone(),
seq seq
), ),
0 0
); )
return Ok((fi, true)); } else {
} self.frame_invariants[&(idx - 1)].clone()
};
let mut fi = self.frame_invariants[&(idx - 1)].clone();
// Initially set up the frame as an inter frame. // Initially set up the frame as an inter frame.
// We need to determine what the frame number is before we can // We need to determine what the frame number is before we can
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment