Bug 1245463: [MSE] P1. Do not attempt to retrieve the buffered range if the mediasource is in closed state. r=gerald

The changes that follow may cause the active sourcebuffer list to be modified; which will trigger an assertion if the mediasource object is closed.

MozReview-Commit-ID: 8A1CMKAUyTq
This commit is contained in:
Jean-Yves Avenard 2016-02-10 17:06:18 +11:00
Родитель bf2ce4db2f
Коммит aceca098dd
1 изменённых файлов: 6 добавлений и 0 удалений

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

@ -256,6 +256,12 @@ MediaDecoderOwner::NextFrameStatus
MediaSourceDecoder::NextFrameBufferedStatus()
{
MOZ_ASSERT(NS_IsMainThread());
if (!mMediaSource ||
mMediaSource->ReadyState() == dom::MediaSourceReadyState::Closed) {
return MediaDecoderOwner::NEXT_FRAME_UNAVAILABLE;
}
// Next frame hasn't been decoded yet.
// Use the buffered range to consider if we have the next frame available.
TimeUnit currentPosition = TimeUnit::FromMicroseconds(CurrentPosition());