Skip to content

Commit

Permalink
Bug 1489375 - part1 : do not recreate AudioChannelAgent. r=padenot
Browse files Browse the repository at this point in the history
When calling resume() on a running AudioContext, there is no need to discard current AudioChannelAgent and then create a new one.

Differential Revision: https://phabricator.services.mozilla.com/D5799
  • Loading branch information
alastor0325 committed Sep 18, 2018
1 parent 0a4467d commit ecdffc0
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions dom/media/webaudio/AudioDestinationNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,20 +597,12 @@ AudioDestinationNode::WindowAudioCaptureChanged(bool aCapture)
nsresult
AudioDestinationNode::CreateAudioChannelAgent()
{
if (mIsOffline) {
if (mIsOffline || mAudioChannelAgent) {
return NS_OK;
}

nsresult rv = NS_OK;
if (mAudioChannelAgent) {
rv = mAudioChannelAgent->NotifyStoppedPlaying();
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
}

mAudioChannelAgent = new AudioChannelAgent();
rv = mAudioChannelAgent->InitWithWeakCallback(GetOwner(), this);
nsresult rv = mAudioChannelAgent->InitWithWeakCallback(GetOwner(), this);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
Expand Down

0 comments on commit ecdffc0

Please sign in to comment.