Bug 1246521: P2. Add MediaDecoder::OwnerHasError method. r=gerald

This commit is contained in:
Jean-Yves Avenard 2016-02-08 15:28:15 +11:00
Родитель 722e4fee21
Коммит 53c49526d6
2 изменённых файлов: 11 добавлений и 0 удалений

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

@ -1042,6 +1042,13 @@ MediaDecoder::IsEndedOrShutdown() const
return IsEnded() || mPlayState == PLAY_STATE_SHUTDOWN;
}
bool
MediaDecoder::OwnerHasError() const
{
MOZ_ASSERT(NS_IsMainThread());
return mShuttingDown || mOwner->HasError();
}
bool
MediaDecoder::IsEnded() const
{

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

@ -234,6 +234,10 @@ public:
// Call on the main thread only.
virtual bool IsEndedOrShutdown() const;
// Return true if the MediaDecoderOwner's error attribute is not null.
// If the MediaDecoder is shutting down, OwnerHasError will return true.
bool OwnerHasError() const;
protected:
// Updates the media duration. This is called while the media is being
// played, calls before the media has reached loaded metadata are ignored.