mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 815452 - Don't unmute FM audio if the user increases the volume when FM audio is muted for channel policy reasons. r=sicking
This commit is contained in:
parent
ef07f2b80f
commit
d39fa81ef3
@ -70,7 +70,7 @@ if ("nsIAudioManager" in Ci) {
|
||||
const nsIAudioManager = Ci.nsIAudioManager;
|
||||
audioChannelSettings = [
|
||||
// settings name, max value, apply to stream types
|
||||
['audio.volume.content', 15, [nsIAudioManager.STREAM_TYPE_SYSTEM, nsIAudioManager.STREAM_TYPE_MUSIC, nsIAudioManager.STREAM_TYPE_FM]],
|
||||
['audio.volume.content', 15, [nsIAudioManager.STREAM_TYPE_SYSTEM, nsIAudioManager.STREAM_TYPE_MUSIC]],
|
||||
['audio.volume.notification', 15, [nsIAudioManager.STREAM_TYPE_RING, nsIAudioManager.STREAM_TYPE_NOTIFICATION]],
|
||||
['audio.volume.alarm', 15, [nsIAudioManager.STREAM_TYPE_ALARM]],
|
||||
['audio.volume.telephony', 5, [nsIAudioManager.STREAM_TYPE_VOICE_CALL]],
|
||||
|
@ -393,10 +393,16 @@ NS_IMETHODIMP
|
||||
AudioManager::SetStreamVolumeIndex(int32_t aStream, int32_t aIndex) {
|
||||
status_t status =
|
||||
AudioSystem::setStreamVolumeIndex(static_cast<audio_stream_type_t>(aStream), aIndex);
|
||||
// sync the fm stream volume with music volume
|
||||
if (aStream == AUDIO_STREAM_MUSIC && IsDeviceOn(AUDIO_DEVICE_OUT_FM)) {
|
||||
|
||||
// sync the fm stream volume with music volume, except set fm volume by audioChannelServices
|
||||
if (aStream == AUDIO_STREAM_FM && IsDeviceOn(AUDIO_DEVICE_OUT_FM)) {
|
||||
mFMChannelIsMuted = aIndex == 0;
|
||||
}
|
||||
// sync fm volume with music stream type
|
||||
if (aStream == AUDIO_STREAM_MUSIC && IsDeviceOn(AUDIO_DEVICE_OUT_FM) && !mFMChannelIsMuted) {
|
||||
AudioSystem::setStreamVolumeIndex(static_cast<audio_stream_type_t>(AUDIO_STREAM_FM), aIndex);
|
||||
}
|
||||
|
||||
return status ? NS_ERROR_FAILURE : NS_OK;
|
||||
}
|
||||
|
||||
|
@ -52,6 +52,7 @@ protected:
|
||||
|
||||
private:
|
||||
nsAutoPtr<mozilla::hal::SwitchObserver> mObserver;
|
||||
bool mFMChannelIsMuted;
|
||||
};
|
||||
|
||||
} /* namespace gonk */
|
||||
|
Loading…
Reference in New Issue
Block a user