author | JW Wang <jwwang@mozilla.com> |
Tue, 31 May 2016 14:33:03 +0800 | |
changeset 340889 | bc2bd91854befe145331375bb36cb89dd3f9f3ba |
parent 340888 | bdb2c38f67dfa6fec43aa81b1e6e0153fd9d9554 |
child 340890 | b6fe7fa88db0a4103d175bf5b02cd47c2c6722e6 |
push id | 1183 |
push user | raliiev@mozilla.com |
push date | Mon, 05 Sep 2016 20:01:49 +0000 |
treeherder | mozilla-release@3148731bed45 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | kinetik |
bugs | 1276852 |
milestone | 49.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
|
--- a/dom/media/AudioStream.cpp +++ b/dom/media/AudioStream.cpp @@ -396,26 +396,20 @@ AudioStream::SetVolume(double aVolume) NS_WARNING("Could not change volume on cubeb stream."); } } void AudioStream::Start() { MonitorAutoLock mon(mMonitor); - if (mState == INITIALIZED) { - // DataCallback might be called before InvokeCubeb returns - // if cubeb_stream_start() succeeds. mState must be set to STARTED - // beforehand. - mState = STARTED; - if (InvokeCubeb(cubeb_stream_start) != CUBEB_OK) { - mState = ERRORED; - } - LOG("started, state %s", mState == STARTED ? "STARTED" : "ERRORED"); - } + MOZ_ASSERT(mState == INITIALIZED); + auto r = InvokeCubeb(cubeb_stream_start); + mState = r == CUBEB_OK ? STARTED : ERRORED; + LOG("started, state %s", mState == STARTED ? "STARTED" : "ERRORED"); } void AudioStream::Pause() { MonitorAutoLock mon(mMonitor); if (mState == ERRORED) {