Closed Bug 1197125 Opened 9 years ago Closed 9 years ago

WebMDemuxer will read the entire webm into memory if the file is local

Categories

(Core :: Audio/Video: Playback, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla43
Tracking Status
firefox41 --- unaffected
firefox42 --- fixed
firefox43 --- fixed

People

(Reporter: jya, Assigned: jya)

References

Details

(Keywords: regression)

Attachments

(1 file)

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.
Assignee: nobody → jyavenard
Priority: -- → P1
Instead we parse it in chunks of 1MiB max.
Attachment #8653827 - Flags: review?(kinetik)
Attachment #8653827 - Flags: review?(kinetik) → review+
Blocks: 1197083
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
Backed out for a youtube playback regression. See Bug 1199573. https://hg.mozilla.org/releases/mozilla-aurora/rev/5bb661db5c6c
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → RESOLVED
Closed: 9 years ago9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: