diff options
Diffstat (limited to 'dom/media/MediaDecoderStateMachine.cpp')
-rw-r--r-- | dom/media/MediaDecoderStateMachine.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/dom/media/MediaDecoderStateMachine.cpp b/dom/media/MediaDecoderStateMachine.cpp index 2ed1956c9..63222c22c 100644 --- a/dom/media/MediaDecoderStateMachine.cpp +++ b/dom/media/MediaDecoderStateMachine.cpp @@ -1238,7 +1238,12 @@ DecodeMetadataState::OnMetadataRead(MetadataHolder* aMetadata) // feeding in the CDM, which we need to decode the first frame (and // thus get the metadata). We could fix this if we could compute the start // time by demuxing without necessaring decoding. - bool waitingForCDM = Info().IsEncrypted() && !mMaster->mCDMProxy; + bool waitingForCDM = +#ifdef MOZ_EME + mMaster->Info().IsEncrypted() && !mMaster->mCDMProxy; +#else + false; +#endif mMaster->mNotifyMetadataBeforeFirstFrame = mMaster->mDuration.Ref().isSome() || waitingForCDM; @@ -1262,7 +1267,9 @@ DormantState::HandlePlayStateChanged(MediaDecoder::PlayState aPlayState) { if (aPlayState == MediaDecoder::PLAY_STATE_PLAYING) { // Exit dormant when the user wants to play. +#ifdef MOZ_EME MOZ_ASSERT(!Info().IsEncrypted() || mMaster->mCDMProxy); +#endif MOZ_ASSERT(mMaster->mSentFirstFrameLoadedEvent); SetState<SeekingState>(Move(mPendingSeek), EventVisibility::Suppressed); } @@ -1575,7 +1582,9 @@ ShutdownState::Enter() // dispose of the timer. master->mVideoDecodeSuspendTimer.Reset(); +#ifdef MOZ_EME master->mCDMProxyPromise.DisconnectIfExists(); +#endif if (master->IsPlaying()) { master->StopPlayback(); @@ -2129,10 +2138,12 @@ nsresult MediaDecoderStateMachine::Init(MediaDecoder* aDecoder) mMediaSink = CreateMediaSink(mAudioCaptured); +#ifdef MOZ_EME mCDMProxyPromise.Begin(aDecoder->RequestCDMProxy()->Then( OwnerThread(), __func__, this, &MediaDecoderStateMachine::OnCDMProxyReady, &MediaDecoderStateMachine::OnCDMProxyNotReady)); +#endif nsresult rv = mReader->Init(); NS_ENSURE_SUCCESS(rv, rv); @@ -3108,6 +3119,7 @@ void MediaDecoderStateMachine::OnMediaSinkAudioError(nsresult aResult) DecodeError(MediaResult(NS_ERROR_DOM_MEDIA_MEDIASINK_ERR, __func__)); } +#ifdef MOZ_EME void MediaDecoderStateMachine::OnCDMProxyReady(RefPtr<CDMProxy> aProxy) { @@ -3124,6 +3136,7 @@ MediaDecoderStateMachine::OnCDMProxyNotReady() MOZ_ASSERT(OnTaskQueue()); mCDMProxyPromise.Complete(); } +#endif void MediaDecoderStateMachine::SetAudioCaptured(bool aCaptured) |