Closed Bug 1197125 Opened 4 years ago Closed 4 years ago
MDemuxer will read the entire webm into memory if the file is local
Noticed this problem when reviewing why bug 1195073 was failing on linux. WebMDemuxer::EnsureUpToDateIndex will call MediaResource::GetCachedRanges() retrieve the array of byte ranges and call WebMBufferedState::WebMBufferedState::UpdateIndex() this will call MediaResource::MediaReadAt() and read the entire byte range. However, for local files, the cache byte range is always the entire file. As such, the entire file will first be read into memory, and then parsed. So to play a local file, we will potentially allocate a very big array. This will also limit us to play 2GiB files only as a nsTArray can't hold more than 2GiB Reads should be made using partial blocks, to ensure we allocate too much RAM at once.
Instead we parse it in chunks of 1MiB max.
Attachment #8653827 - Flags: review?(kinetik)
Attachment #8653827 - Flags: review?(kinetik) → review+
Backed out for a youtube playback regression. See Bug 1199573. https://hg.mozilla.org/releases/mozilla-aurora/rev/5bb661db5c6c
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
pushed it as part of https://hg.mozilla.org/releases/mozilla-aurora/pushloghtml?changeset=7437f28133fc
You need to log in before you can comment on or make changes to this bug.