Closed Bug 1165145 Opened 5 years ago Closed 5 years ago

Incorrect MediaSource buffered range being reported in ended mode.


(Core :: Audio/Video, defect)

Not set



Tracking Status
firefox41 --- fixed


(Reporter: jya, Assigned: jya)


(Blocks 1 open bug)



(3 files)

The MediaSourceReader::GetBuffered() when in ended mode adjust the buffered range so they all end at the same level as the highest end time across source buffer.

This is wrong.

Only a sourcebuffer is to perform such alignment and across the trackbuffers.

This cause webref mediasource-buffered.html to fail.
We could report time ranges such as [-1 0] as GetEndTime on an empty TimeRanges return -1
Attachment #8606083 - Flags: review?(karlt)
Assignee: nobody → jyavenard
Take "If readyState is ended, then set the end time on the last range in source ranges to highest end time." literally. That is is there s no last range, there s nothing to set.
Attachment #8606085 - Flags: review?(karlt)
Update webref
Attachment #8606086 - Flags: review?(karlt)

got a previous green try, but made some changes up the chain so redoing them just in case.
Attachment #8606085 - Flags: review?(karlt) → review+
Attachment #8606086 - Flags: review?(karlt) → review+
Comment on attachment 8606083 [details] [diff] [review]
Part1. Never reports negative time ranges with MSE

I had assumed from the commit message that this was meant to remove an existing negative time range, and so it took me a while to work out that this is to prevent adding a (-1,0) time range here because TimeRanges::GetEndTime() returns -1 when there are no ranges, while TrackBuffer::Buffered() returns 0.

Can you change the comment to say "don't add a negative time range to empty buffered ranges" or similar, please?

An alternative fix, possibly making the code easier to follow would be to make Buffered() return -1, like GetEndTime().  However, I guess this is being rewritten in bug 1163445 anyway.
Attachment #8606083 - Flags: review?(karlt) → review+
You need to log in before you can comment on or make changes to this bug.