Bug 1525278 - Assert AudioStream is not errored when SetVolume is called. r=jya

Differential Revision: https://phabricator.services.mozilla.com/D18682

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Alex Chronopoulos 2019-02-14 11:13:38 +00:00
parent 6dd524af5b
commit 16529fa15f

View File

@ -397,12 +397,11 @@ nsresult AudioStream::OpenCubeb(cubeb* aContext, cubeb_stream_params& aParams,
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.");
MOZ_DIAGNOSTIC_ASSERT(mState != ERRORED, "Don't set volume if stream got error.");
}
#endif
if (cubeb_stream_set_volume(mCubebStream.get(),
aVolume * CubebUtils::GetVolumeScale()) !=