Bug 1314526. Part 2 - fix HandleAudioDecoded(). draft
authorJW Wang <jwwang@mozilla.com>
Fri, 28 Oct 2016 16:27:19 +0800
changeset 433071 c7fa3ce4771da0f8c7299f9f06136db5531bef13
parent 433070 b63e26cf701d74d7123243f7ac874cc1554aec5b
child 433072 b6e5286439c50ae0fe530cc8fc533ad3fd799436
push id34475
push userjwwang@mozilla.com
push dateThu, 03 Nov 2016 03:28:38 +0000
bugs1314526
milestone52.0a1
Bug 1314526. Part 2 - fix HandleAudioDecoded(). MozReview-Commit-ID: 1jbZz5m9uR2
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -189,18 +189,17 @@ class MediaDecoderStateMachine::StateObj
 public:
   virtual ~StateObject() {}
   virtual void Exit() {};  // Exit action.
   virtual void Step() {}   // Perform a 'cycle' of this state object.
   virtual State GetState() const = 0;
 
   // Event handlers for various events.
   virtual void HandleCDMProxyReady() {}
-
-  virtual bool HandleAudioDecoded(MediaData* aAudio) { return false; }
+  virtual void HandleAudioDecoded(MediaData* aAudio) {}
 
   virtual bool HandleVideoDecoded(MediaData* aVideo, TimeStamp aDecodeStart)
   {
     return false;
   }
 
   virtual bool HandleEndOfStream() { return false; }
 
@@ -474,21 +473,20 @@ public:
     mPendingSeek.RejectIfExists(__func__);
   }
 
   State GetState() const override
   {
     return DECODER_STATE_DECODING_FIRSTFRAME;
   }
 
-  bool HandleAudioDecoded(MediaData* aAudio) override
+  void HandleAudioDecoded(MediaData* aAudio) override
   {
     mMaster->Push(aAudio, MediaData::AUDIO_DATA);
     MaybeFinishDecodeFirstFrame();
-    return true;
   }
 
   bool HandleVideoDecoded(MediaData* aVideo, TimeStamp aDecodeStart) override
   {
     mMaster->Push(aVideo, MediaData::VIDEO_DATA);
     MaybeFinishDecodeFirstFrame();
     return true;
   }
@@ -574,21 +572,20 @@ public:
     MaybeStartBuffering();
   }
 
   State GetState() const override
   {
     return DECODER_STATE_DECODING;
   }
 
-  bool HandleAudioDecoded(MediaData* aAudio) override
+  void HandleAudioDecoded(MediaData* aAudio) override
   {
     mMaster->Push(aAudio, MediaData::AUDIO_DATA);
     MaybeStopPrerolling();
-    return true;
   }
 
   bool HandleVideoDecoded(MediaData* aVideo, TimeStamp aDecodeStart) override
   {
     mMaster->Push(aVideo, MediaData::VIDEO_DATA);
     MaybeStopPrerolling();
     CheckSlowDecoding(aDecodeStart);
     return true;
@@ -848,20 +845,19 @@ public:
     mMaster->SetMediaDecoderReaderWrapperCallback();
   }
 
   State GetState() const override
   {
     return DECODER_STATE_SEEKING;
   }
 
-  bool HandleAudioDecoded(MediaData* aAudio) override
+  void HandleAudioDecoded(MediaData* aAudio) override
   {
     MOZ_ASSERT(false);
-    return true;
   }
 
   bool HandleVideoDecoded(MediaData* aVideo, TimeStamp aDecodeStart) override
   {
     MOZ_ASSERT(false);
     return true;
   }
 
@@ -961,23 +957,22 @@ public:
 
   void Step() override;
 
   State GetState() const override
   {
     return DECODER_STATE_BUFFERING;
   }
 
-  bool HandleAudioDecoded(MediaData* aAudio) override
+  void HandleAudioDecoded(MediaData* aAudio) override
   {
     // This might be the sample we need to exit buffering.
     // Schedule Step() to check it.
     mMaster->Push(aAudio, MediaData::AUDIO_DATA);
     mMaster->ScheduleStateMachine();
-    return true;
   }
 
   bool HandleVideoDecoded(MediaData* aVideo, TimeStamp aDecodeStart) override
   {
     // This might be the sample we need to exit buffering.
     // Schedule Step() to check it.
     mMaster->Push(aVideo, MediaData::VIDEO_DATA);
     mMaster->ScheduleStateMachine();