Bug 1125804 - Remove the mixer callback when failing to open an audio stream when switching to an audio driver. r=jesup

This commit is contained in:
Paul Adenot 2015-02-09 14:43:55 +01:00
parent e10e26c257
commit d14cafacf6
2 changed files with 7 additions and 0 deletions

View File

@ -612,6 +612,8 @@ AudioCallbackDriver::Init()
mNextDriver->SetGraphTime(this, mIterationStart, mIterationEnd,
mStateComputedTime, mNextStateComputedTime);
mGraphImpl->SetCurrentDriver(mNextDriver);
DebugOnly<bool> found = mGraphImpl->RemoveMixerCallback(this);
NS_WARN_IF_FALSE(!found, "Mixer callback not added when switching?");
mNextDriver->Start();
return;
}

View File

@ -430,6 +430,11 @@ public:
return mDriver;
}
bool RemoveMixerCallback(MixerCallbackReceiver* aReceiver)
{
return mMixer.RemoveCallback(aReceiver);
}
/**
* Effectively set the new driver, while we are switching.
* It is only safe to call this at the very end of an iteration, when there