mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-11-13 23:31:37 -05:00
shrink mp4::Segment by another 24 bytes on 32-bit
This is 1,440 bytes for a 60-segment .mp4, so another modest cache improvement.
This commit is contained in:
@@ -827,12 +827,12 @@ impl FileBuilder {
|
||||
// The actual range may start before the desired range because it can only start on a
|
||||
// key frame. This relationship should hold true:
|
||||
// actual start <= desired start < desired end
|
||||
let actual = s.s.actual_time_90k();
|
||||
let skip = s.s.desired_range_90k.start - actual.start;
|
||||
let actual_start_90k = s.s.actual_start_90k();
|
||||
let skip = s.s.desired_range_90k.start - actual_start_90k;
|
||||
let keep = s.s.desired_range_90k.end - s.s.desired_range_90k.start;
|
||||
assert!(skip >= 0 && keep > 0, "segment {}/{}: desired={}..{} actual={}..{}",
|
||||
assert!(skip >= 0 && keep > 0, "segment {}/{}: desired={}..{} actual_start={}",
|
||||
s.s.camera_id, s.s.recording_id, s.s.desired_range_90k.start,
|
||||
s.s.desired_range_90k.end, actual.start, actual.end);
|
||||
s.s.desired_range_90k.end, actual_start_90k);
|
||||
cur_media_time += skip as u64;
|
||||
if unflushed.segment_duration + unflushed.media_time == cur_media_time {
|
||||
unflushed.segment_duration += keep as u64;
|
||||
|
||||
Reference in New Issue
Block a user