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:
Scott Lamb
2017-03-27 20:55:58 -07:00
parent b83f1f923f
commit 30cda85a2e
2 changed files with 31 additions and 21 deletions

View File

@@ -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;