X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-core%2Fsrc%2Freorder.rs;h=ebd7bdfcafa40d1196228dcda16905c9f83aa2d3;hb=HEAD;hp=e8ef62261a16aa6dd75ce2be2802949bc742e733;hpb=4213ad5979331cc06dfef79c00b7f0615ffed0d9;p=nihav.git diff --git a/nihav-core/src/reorder.rs b/nihav-core/src/reorder.rs index e8ef622..9337b9a 100644 --- a/nihav-core/src/reorder.rs +++ b/nihav-core/src/reorder.rs @@ -226,6 +226,7 @@ impl MTFrameReorderer { } /// Gets the next frame to be displayed (or `None` if that is not possible). #[allow(clippy::collapsible_if)] + #[allow(clippy::collapsible_else_if)] pub fn get_frame(&mut self) -> Option { // check if we have consequent timestamps that we can output if !self.frames.is_empty() { @@ -255,7 +256,7 @@ impl MTFrameReorderer { } let end = self.ids.iter().position(|&id| id == kf_id).unwrap(); for ref_id in self.ids[..end].iter() { - if self.frames.iter().position(|(id, _)| id == ref_id).is_none() { + if !self.frames.iter().any(|(id, _)| id == ref_id) { return None; } } @@ -286,6 +287,7 @@ impl MTFrameReorderer { pub fn flush(&mut self) { self.flush_mode = false; self.frames.clear(); + self.ids.clear(); self.output_to = None; self.last_ts = None; }