diff options
author | Sangchul Lee <sc11.lee@samsung.com> | 2019-07-18 13:06:22 +0900 |
---|---|---|
committer | Sangchul Lee <sc11.lee@samsung.com> | 2019-07-18 13:06:22 +0900 |
commit | c48d8ac46662c7eb4a24813da5302a5f4112e6da (patch) | |
tree | bb7f2692998afe3a3e5190a0361b9a17dc14a548 | |
parent | 958c83f2a5ef336e54285f332c58720eaff714ba (diff) | |
download | audio-hal-sc7727-c48d8ac46662c7eb4a24813da5302a5f4112e6da.tar.gz audio-hal-sc7727-c48d8ac46662c7eb4a24813da5302a5f4112e6da.tar.bz2 audio-hal-sc7727-c48d8ac46662c7eb4a24813da5302a5f4112e6da.zip |
Fix noise when unmuting radio volumetizen_5.5.m2_releasesubmit/tizen_5.5_wearable_hotfix/20201026.184301submit/tizen_5.5_mobile_hotfix/20201026.185101submit/tizen_5.5/20191031.000013submit/tizen_5.5/20191031.000012submit/tizen_5.5/20191031.000011submit/tizen_5.5/20191031.000002submit/tizen/20200709.065706submit/tizen/20190718.054451accepted/tizen/unified/20190719.111655accepted/tizen/5.5/unified/wearable/hotfix/20201027.122856accepted/tizen/5.5/unified/mobile/hotfix/20201027.081443accepted/tizen/5.5/unified/20191031.033136tizen_5.5_wearable_hotfixtizen_5.5_tvtizen_5.5_mobile_hotfixtizen_5.5accepted/tizen_5.5_unified_wearable_hotfixaccepted/tizen_5.5_unified_mobile_hotfixaccepted/tizen_5.5_unified
[Version] 0.1.31
[Issue Type] Improvement
Change-Id: I8b8063986c3e17d812afcf654c099967ec70919a
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
-rw-r--r-- | packaging/audio-hal-sc7727.spec | 2 | ||||
-rw-r--r-- | tizen-audio-volume.c | 27 |
2 files changed, 16 insertions, 13 deletions
diff --git a/packaging/audio-hal-sc7727.spec b/packaging/audio-hal-sc7727.spec index ffa9242..a575d74 100644 --- a/packaging/audio-hal-sc7727.spec +++ b/packaging/audio-hal-sc7727.spec @@ -1,6 +1,6 @@ Name: audio-hal-sc7727 Summary: TIZEN Audio HAL for SC7727 -Version: 0.1.30 +Version: 0.1.31 Release: 0 Group: System/Libraries License: Apache-2.0 diff --git a/tizen-audio-volume.c b/tizen-audio-volume.c index 97e445c..8dd03f1 100644 --- a/tizen-audio-volume.c +++ b/tizen-audio-volume.c @@ -360,18 +360,6 @@ static audio_return_t _audio_volume_set_ratio_radio(audio_hal_t *ah, double rati goto set_volume; } - /* Unmute if muted */ - if ((audio_ret = _mixer_control_get_value(ah, MIXER_FMRADIO_MUTE, &mute))) { - AUDIO_LOG_ERROR("[mute get] get mixer(%s) failed", MIXER_FMRADIO_MUTE); - return audio_ret; - } - if (mute == FMRADIO_MUTE_ON) { - if ((audio_ret = _mixer_control_set_value(ah, MIXER_FMRADIO_MUTE, FMRADIO_MUTE_OFF))) { - AUDIO_LOG_ERROR("[mute off] set mixer(%s) failed", MIXER_FMRADIO_MUTE); - return audio_ret; - } - } - max_value = ah->volume.radio_volume_value_table[ah->volume.radio_volume_num_of_levels - 1]; min_value = ah->volume.radio_volume_value_table[0]; new_value = (int) (ratio * (max_value - min_value) + min_value); @@ -399,6 +387,21 @@ set_volume: } } + if (ratio == 0) + return audio_ret; + + /* Unmute if muted */ + if ((audio_ret = _mixer_control_get_value(ah, MIXER_FMRADIO_MUTE, &mute))) { + AUDIO_LOG_ERROR("[mute get] get mixer(%s) failed", MIXER_FMRADIO_MUTE); + return audio_ret; + } + if (mute == FMRADIO_MUTE_ON) { + if ((audio_ret = _mixer_control_set_value(ah, MIXER_FMRADIO_MUTE, FMRADIO_MUTE_OFF))) { + AUDIO_LOG_ERROR("[mute off] set mixer(%s) failed", MIXER_FMRADIO_MUTE); + return audio_ret; + } + } + return audio_ret; } |