Bug 1133625: Part2. Don't accept buffer exceeding our threshold. r=cajbir

YouTube attempts to load data in excess of 8MB when close to the end of the
video, and never attempts to re-append should it error. As such,
the sourcebuffer threshold can't be set to lower than 8MB with this change.
This commit is contained in:
Jean-Yves Avenard 2015-02-20 14:19:14 +13:00
parent 5d262eea0b
commit bd730cc79a

View File

@ -562,8 +562,9 @@ SourceBuffer::PrepareAppend(const uint8_t* aData, uint32_t aLength, ErrorResult&
// See if we have enough free space to append our new data.
// As we can only evict once we have playable data, we must give a chance
// to the DASH player to provide a complete media segment.
if ((mTrackBuffer->GetSize() > mEvictionThreshold - aLength) &&
!mTrackBuffer->HasOnlyIncompleteMedia()) {
if (aLength > mEvictionThreshold ||
((mTrackBuffer->GetSize() > mEvictionThreshold - aLength) &&
!mTrackBuffer->HasOnlyIncompleteMedia())) {
aRv.Throw(NS_ERROR_DOM_QUOTA_EXCEEDED_ERR);
return nullptr;
}