Fix rounding issues causing slight gaps in MP4 time ranges.

RESOLVED FIXED in mozilla34

Status

()

Core
Audio/Video
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: kentuckyfriedtakahe, Assigned: kentuckyfriedtakahe)

Tracking

Trunk
mozilla34
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Fragments can have a rounding error of 1 timescale unit per sample. This gets reported as a discontinuity in the buffered time ranges. It makes sense to wallpaper over this discontinuity because it is inconsequential.
Created attachment 8477242 [details] [diff] [review]
Fix MP4 timestamp discontinuities due to rounding
Attachment #8477242 - Flags: review?(edwin)
Comment on attachment 8477242 [details] [diff] [review]
Fix MP4 timestamp discontinuities due to rounding

Review of attachment 8477242 [details] [diff] [review]:
-----------------------------------------------------------------

::: media/libstagefright/binding/mp4_demuxer.cpp
@@ +252,5 @@
>    uint64_t offset = std::numeric_limits<uint64_t>::max();
>    for (int i = 0; i < mPrivate->mIndexes.Length(); i++) {
>      offset = std::min(offset, mPrivate->mIndexes[i]->GetEvictionOffset(aTime));
>    }
> +  return offset == std::numeric_limits<uint64_t>::max() ? 0 : offset;

0 is a valid offset. This should return -1.
Attachment #8477242 - Flags: review?(edwin) → review+
https://hg.mozilla.org/mozilla-central/rev/2cacfcfb3def
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.