diff options
author | trav90 <travawine@openmailbox.org> | 2017-10-25 03:28:25 -0500 |
---|---|---|
committer | trav90 <travawine@openmailbox.org> | 2017-10-25 03:28:25 -0500 |
commit | 2ab33cc3e54aa7ee3da867082369af88044c4789 (patch) | |
tree | 32a662cc4a92b1d3237db56161a8c7608efd0923 | |
parent | d1e0736f77503e61a1394b501b129d86f92351f6 (diff) | |
download | palemoon-gre-2ab33cc3e54aa7ee3da867082369af88044c4789.tar.gz |
Rename MediaDecoder::UpdateDecodedStream to MediaDecoder::UpdateStreamBlockingForPlayState
-rw-r--r-- | dom/media/MediaDecoder.cpp | 23 | ||||
-rw-r--r-- | dom/media/MediaDecoder.h | 2 |
2 files changed, 11 insertions, 14 deletions
diff --git a/dom/media/MediaDecoder.cpp b/dom/media/MediaDecoder.cpp index fd7cae624..b65570a7f 100644 --- a/dom/media/MediaDecoder.cpp +++ b/dom/media/MediaDecoder.cpp @@ -300,16 +300,17 @@ void MediaDecoder::SetVolume(double aVolume) mVolume = aVolume; } -void MediaDecoder::UpdateDecodedStream() +void MediaDecoder::UpdateStreamBlockingForPlayState() { MOZ_ASSERT(NS_IsMainThread()); GetReentrantMonitor().AssertCurrentThreadIn(); - if (GetDecodedStream()) { + auto s = GetDecodedStream(); + if (s) { bool blockForPlayState = mPlayState != PLAY_STATE_PLAYING || mLogicallySeeking; - if (GetDecodedStream()->mHaveBlockedForPlayState != blockForPlayState) { - GetDecodedStream()->mStream->ChangeExplicitBlockerCount(blockForPlayState ? 1 : -1); - GetDecodedStream()->mHaveBlockedForPlayState = blockForPlayState; + if (s->mHaveBlockedForPlayState != blockForPlayState) { + s->mStream->ChangeExplicitBlockerCount(blockForPlayState ? 1 : -1); + s->mHaveBlockedForPlayState = blockForPlayState; } } } @@ -344,11 +345,7 @@ void MediaDecoder::RecreateDecodedStream(int64_t aStartTimeUSecs) mDecodedStream.RecreateData(aStartTimeUSecs, MediaStreamGraph::GetInstance()); UpdateStreamBlockingForStateMachinePlaying(); - - GetDecodedStream()->mHaveBlockedForPlayState = mPlayState != PLAY_STATE_PLAYING; - if (GetDecodedStream()->mHaveBlockedForPlayState) { - GetDecodedStream()->mStream->ChangeExplicitBlockerCount(1); - } + UpdateStreamBlockingForPlayState(); } void MediaDecoder::AddOutputStream(ProcessedMediaStream* aStream, @@ -652,7 +649,7 @@ nsresult MediaDecoder::Seek(double aTime, SeekTarget::Type aSeekType) mWasEndedWhenEnteredDormant = false; mLogicallySeeking = true; - UpdateDecodedStream(); + UpdateStreamBlockingForPlayState(); SeekTarget target = SeekTarget(timeUsecs, aSeekType); CallSeek(target); @@ -1073,7 +1070,7 @@ void MediaDecoder::OnSeekResolved(SeekResolveValue aVal) ChangeState(PLAY_STATE_ENDED); } mLogicallySeeking = false; - UpdateDecodedStream(); + UpdateStreamBlockingForPlayState(); } UpdateLogicalPosition(aVal.mEventVisibility); @@ -1119,7 +1116,7 @@ void MediaDecoder::ChangeState(PlayState aState) gPlayStateStr[mPlayState], gPlayStateStr[aState]); mPlayState = aState; - UpdateDecodedStream(); + UpdateStreamBlockingForPlayState(); if (mPlayState == PLAY_STATE_PLAYING) { ConstructMediaTracks(); diff --git a/dom/media/MediaDecoder.h b/dom/media/MediaDecoder.h index d2cbe01b6..62cc296ac 100644 --- a/dom/media/MediaDecoder.h +++ b/dom/media/MediaDecoder.h @@ -391,7 +391,7 @@ public: // replaying after the input as ended. In the latter case, the new source is // not connected to streams created by captureStreamUntilEnded. - void UpdateDecodedStream(); + void UpdateStreamBlockingForPlayState(); /** * Recreates mDecodedStream. Call this to create mDecodedStream at first, |