Bug 1314526. Part 2 - fix HandleAudioDecoded(). r=kikuo
authorJW Wang <jwwang@mozilla.com>
Fri, 28 Oct 2016 16:27:19 +0800
changeset 351546 30ab9b36441b43942cbc685f5e4ee4cd67163d80
parent 351545 5d5799848acf017b982b8febf15a9ca154a09473
child 351547 214d895597a04db686d0be4c459c994153c00eae
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskikuo
bugs1314526
milestone52.0a1
Bug 1314526. Part 2 - fix HandleAudioDecoded(). r=kikuo 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();