Bug 1325905. Part 5 - let DecodingFirstFrameState override Handle{Audio,Video}Waited.
We want to call Request{Audio,Video}Data() instead of Ensure{Audio,Video}DecodeTaskQueued
which checks mState and breaks the encapsulation of the state objects.
MozReview-Commit-ID: 5oydItSvnMF
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -495,16 +495,26 @@ public:
{
mMaster->PushVideo(aVideo);
MaybeFinishDecodeFirstFrame();
}
void HandleAudioNotDecoded(const MediaResult& aError) override;
void HandleVideoNotDecoded(const MediaResult& aError) override;
+ void HandleAudioWaited(MediaData::Type aType) override
+ {
+ mMaster->RequestAudioData();
+ }
+
+ void HandleVideoWaited(MediaData::Type aType) override
+ {
+ mMaster->RequestVideoData(false, media::TimeUnit());
+ }
+
void HandleVideoSuspendTimeout() override
{
// Do nothing for we need to decode the 1st video frame to get the dimensions.
}
void HandleResumeVideoDecoding() override
{
// We never suspend video decoding in this state.