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);
}
}
+ 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;
}