зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1194188: [MSE] Don't allow call to appendBuffer if media element is in error. r=cpearce
This commit is contained in:
Родитель
cb1d7d0a7d
Коммит
0e869054eb
|
@ -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);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче