Bug 1194188: [MSE] Don't allow call to appendBuffer if media element is in error. r=cpearce

This commit is contained in:
Jean-Yves Avenard 2015-08-14 12:01:15 +10:00
Родитель cb1d7d0a7d
Коммит 0e869054eb
1 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -550,6 +550,15 @@ SourceBuffer::PrepareAppend(const uint8_t* aData, uint32_t aLength, ErrorResult&
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return nullptr;
}
// If the HTMLMediaElement.error attribute is not null, then throw an
// InvalidStateError exception and abort these steps.
if (!mMediaSource->GetDecoder() ||
mMediaSource->GetDecoder()->IsEndedOrShutdown()) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return nullptr;
}
if (mMediaSource->ReadyState() == MediaSourceReadyState::Ended) {
mMediaSource->SetReadyState(MediaSourceReadyState::Open);
}