Bug 1518443 - Assert AudioStream is not closed when volume is set. r=jya
authorAlex Chronopoulos <achronop@gmail.com>
Wed, 09 Jan 2019 17:16:45 +0000
changeset 510229 699fe9e8f434a750ee3ddce587282ae396ea0db2
parent 510228 292cf0b8d5c8b94187f641ea191c8e0067d7353f
child 510230 1e674ee50a1d30961768ac175b0cc769603ffb14
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1518443
milestone66.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 1518443 - Assert AudioStream is not closed when volume is set. r=jya Differential Revision: https://phabricator.services.mozilla.com/D15933
dom/media/AudioStream.cpp
--- a/dom/media/AudioStream.cpp
+++ b/dom/media/AudioStream.cpp
@@ -392,16 +392,23 @@ nsresult AudioStream::OpenCubeb(cubeb* a
                         timeDelta.ToMilliseconds());
 
   return NS_OK;
 }
 
 void AudioStream::SetVolume(double aVolume) {
   MOZ_ASSERT(aVolume >= 0.0 && aVolume <= 1.0, "Invalid volume");
 
+#ifdef DEBUG
+  {
+    MonitorAutoLock mon(mMonitor);
+    MOZ_ASSERT(mState != SHUTDOWN, "Don't set volume after shutdown.");
+  }
+#endif
+
   if (cubeb_stream_set_volume(mCubebStream.get(),
                               aVolume * CubebUtils::GetVolumeScale()) !=
       CUBEB_OK) {
     LOGE("Could not change volume on cubeb stream.");
   }
 }
 
 nsresult AudioStream::Start() {