From 354ad927a8ee620593325f83b99a14a342c69f0c Mon Sep 17 00:00:00 2001 From: JW Wang Date: Wed, 21 Dec 2016 18:23:00 +0800 Subject: [PATCH] Bug 1325905. Part 5 - let DecodingFirstFrameState override Handle{Audio,Video}Waited. r=kaku 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 --HG-- extra : rebase_source : 5da4ad2f0fbf010a78c6b4e7cbab70378a002758 extra : intermediate-source : 0a882fb53fd51a71f9a3914074e9020d4eb87c4f extra : source : 9927e37c9383e9204cbaf1b0dbc6fbfdff48df82 --- dom/media/MediaDecoderStateMachine.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dom/media/MediaDecoderStateMachine.cpp b/dom/media/MediaDecoderStateMachine.cpp index 22774dbc012b..c3b9752084bb 100644 --- a/dom/media/MediaDecoderStateMachine.cpp +++ b/dom/media/MediaDecoderStateMachine.cpp @@ -500,6 +500,16 @@ public: 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.