Commit 74edd383 authored by Luca Barbato's avatar Luca Barbato Committed by Luca Barbato

Be aware of the frame limit in next_keyframe()

Fixes another infiniloop.
parent 5e114f69
...@@ -688,6 +688,7 @@ impl<T: Pixel> ContextInner<T> { ...@@ -688,6 +688,7 @@ impl<T: Pixel> ContextInner<T> {
.find(|fi| fi.frame_type == FrameType::KEY && fi.number > self.segment_start_frame) .find(|fi| fi.frame_type == FrameType::KEY && fi.number > self.segment_start_frame)
.map(|fi| fi.number); .map(|fi| fi.number);
let next_limit = self.segment_start_frame + self.config.max_key_frame_interval; let next_limit = self.segment_start_frame + self.config.max_key_frame_interval;
let next_limit = if self.limit != 0 { next_limit.min(self.limit) } else { next_limit };
if next_detected.is_none() { if next_detected.is_none() {
return next_limit; return next_limit;
} }
......
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