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
parent 8a6301085a
commit f89b386434
2 changed files with 11 additions and 0 deletions

View File

@ -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
{

View File

@ -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.