mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 876133. Ensure output audio volume is updated when 'volume' attribute is set on media element. r=cpearce
--HG-- extra : rebase_source : defbb7d13b70349d321006db37f005888fb6a79e
This commit is contained in:
parent
b3f9ceb38a
commit
94905a3054
@ -796,6 +796,11 @@ protected:
|
||||
* Mute or unmute the audio and change the value that the |muted| map.
|
||||
*/
|
||||
void SetMutedInternal(uint32_t aMuted);
|
||||
/**
|
||||
* Update the volume of the output audio stream to match the element's
|
||||
* current mMuted/mVolume state.
|
||||
*/
|
||||
void SetVolumeInternal();
|
||||
|
||||
/**
|
||||
* Suspend (if aPauseForInactiveDocument) or resume element playback and
|
||||
|
@ -1509,7 +1509,7 @@ HTMLMediaElement::SetVolume(double aVolume, ErrorResult& aRv)
|
||||
mVolume = aVolume;
|
||||
|
||||
// Here we want just to update the volume.
|
||||
SetMutedInternal(mMuted);
|
||||
SetVolumeInternal();
|
||||
|
||||
DispatchAsyncEvent(NS_LITERAL_STRING("volumechange"));
|
||||
}
|
||||
@ -1687,6 +1687,11 @@ void HTMLMediaElement::SetMutedInternal(uint32_t aMuted)
|
||||
return;
|
||||
}
|
||||
|
||||
SetVolumeInternal();
|
||||
}
|
||||
|
||||
void HTMLMediaElement::SetVolumeInternal()
|
||||
{
|
||||
float effectiveVolume = mMuted ? 0.0f : float(mVolume);
|
||||
|
||||
if (mDecoder) {
|
||||
|
Loading…
Reference in New Issue
Block a user