Bug 1276569. Part 1 - remove null checks. r=kinetik.
authorJW Wang <jwwang@mozilla.com>
Mon, 30 May 2016 16:05:28 +0800
changeset 299625 00e04e27ccdd804fe49185f49028a04d14c95f01
parent 299624 ba07e25e6d1d12276609a02d241d90fc01421c23
child 299626 677a8c65e91b1c276bbeecc77d48c161a2ebcc44
push id30299
push usercbook@mozilla.com
push dateTue, 31 May 2016 10:00:19 +0000
treeherdermozilla-central@864cdd00360c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskinetik
bugs1276569
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1276569. Part 1 - remove null checks. r=kinetik. MozReview-Commit-ID: IpX4B2GTr9k
dom/media/AudioStream.cpp
--- a/dom/media/AudioStream.cpp
+++ b/dom/media/AudioStream.cpp
@@ -418,19 +418,16 @@ AudioStream::Start()
   MonitorAutoLock mon(mMonitor);
   StartUnlocked();
 }
 
 void
 AudioStream::StartUnlocked()
 {
   mMonitor.AssertCurrentThreadOwns();
-  if (!mCubebStream) {
-    return;
-  }
 
   if (mState == INITIALIZED) {
     mState = STARTED;
     int r;
     {
       MonitorAutoUnlock mon(mMonitor);
       r = cubeb_stream_start(mCubebStream.get());
       // DataCallback might be called before we exit this scope
@@ -448,17 +445,17 @@ void
 AudioStream::Pause()
 {
   MonitorAutoLock mon(mMonitor);
 
   if (mState == ERRORED) {
     return;
   }
 
-  if (!mCubebStream || (mState != STARTED && mState != RUNNING)) {
+  if (mState != STARTED && mState != RUNNING) {
     mState = STOPPED; // which also tells async OpenCubeb not to start, just init
     return;
   }
 
   int r;
   {
     MonitorAutoUnlock mon(mMonitor);
     r = cubeb_stream_stop(mCubebStream.get());
@@ -467,17 +464,17 @@ AudioStream::Pause()
     mState = STOPPED;
   }
 }
 
 void
 AudioStream::Resume()
 {
   MonitorAutoLock mon(mMonitor);
-  if (!mCubebStream || mState != STOPPED) {
+  if (mState != STOPPED) {
     return;
   }
 
   int r;
   {
     MonitorAutoUnlock mon(mMonitor);
     r = cubeb_stream_start(mCubebStream.get());
   }
@@ -518,17 +515,17 @@ AudioStream::GetPositionInFrames()
   return mAudioClock.GetPositionInFrames();
 }
 
 int64_t
 AudioStream::GetPositionInFramesUnlocked()
 {
   mMonitor.AssertCurrentThreadOwns();
 
-  if (!mCubebStream || mState == ERRORED) {
+  if (mState == ERRORED) {
     return -1;
   }
 
   uint64_t position = 0;
   {
     MonitorAutoUnlock mon(mMonitor);
     if (cubeb_stream_get_position(mCubebStream.get(), &position) != CUBEB_OK) {
       return -1;