Bug 1289976. Part 5 - Remove the IsShutdown() check from MediaDecoder::Pause(). r?kaku draft
authorJW Wang <jwwang@mozilla.com>
Wed, 27 Jul 2016 10:42:20 +0800
changeset 394661 59fd01b400182be2606c38c417e975a637946f1e
parent 394660 987839a737ce38c0de4a416115ac2883dc3470f1
child 394662 2823e093d2a6787544e180e659793f242ea7593c
push id24619
push userjwwang@mozilla.com
push dateSat, 30 Jul 2016 10:57:17 +0000
reviewerskaku
bugs1289976
milestone50.0a1
Bug 1289976. Part 5 - Remove the IsShutdown() check from MediaDecoder::Pause(). r?kaku 1. Pause() is called from HTMLMediaElement and happens before Shutdown(). 2. Pause() is called from SetPlaybackRate() which is called from HTMLMediaElement. MozReview-Commit-ID: DDr7Bg8jkF2
dom/media/MediaDecoder.cpp
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -416,19 +416,17 @@ MediaDecoder::CancelDormantTimer()
     mDormantTimer->Cancel();
   }
 }
 
 void
 MediaDecoder::Pause()
 {
   MOZ_ASSERT(NS_IsMainThread());
-  if (IsShutdown()) {
-    return;
-  }
+  MOZ_ASSERT(!IsShutdown());
   if (mPlayState == PLAY_STATE_LOADING || IsEnded()) {
     mNextState = PLAY_STATE_PAUSED;
     return;
   }
   ChangeState(PLAY_STATE_PAUSED);
 }
 
 void