diff options
author | Eric Laurent <elaurent@google.com> | 2011-08-26 16:48:07 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-08-26 16:48:07 -0700 |
commit | 3cd1d73122bfbfa43c50ddd6e7091865bf5a3559 (patch) | |
tree | 65aab96f36c4f7319a49b062f8cd1905dc21d7d0 /audio | |
parent | 1418850282c0e95ea1f7a1f0ab0f67e866d36260 (diff) | |
parent | 0b70d02f01f9426edc7f4a73291c13587fbd064e (diff) | |
download | device_samsung_tuna-3cd1d73122bfbfa43c50ddd6e7091865bf5a3559.zip device_samsung_tuna-3cd1d73122bfbfa43c50ddd6e7091865bf5a3559.tar.gz device_samsung_tuna-3cd1d73122bfbfa43c50ddd6e7091865bf5a3559.tar.bz2 |
Merge "audio: check for active_input != NULL before following"
Diffstat (limited to 'audio')
-rw-r--r-- | audio/audio_hw.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c index a363f84..518b62b 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -509,14 +509,14 @@ static void set_input_volumes(struct tuna_audio_device *adev, int main_mic_on, int headset_mic_on, int sub_mic_on) { unsigned int channel; - int volume; + int volume = MIXER_ABE_GAIN_0DB; if (adev->mode == AUDIO_MODE_IN_CALL) { /* special case: don't look at input source for IN_CALL state */ volume = DB_TO_ABE_GAIN(main_mic_on ? VOICE_CALL_MAIN_MIC_VOLUME : (headset_mic_on ? VOICE_CALL_HEADSET_MIC_VOLUME : (sub_mic_on ? VOICE_CALL_SUB_MIC_VOLUME : 0))); - } else { + } else if (adev->active_input) { /* determine input volume by use case */ switch (adev->active_input->source) { case AUDIO_SOURCE_MIC: /* general capture */ @@ -544,7 +544,7 @@ static void set_input_volumes(struct tuna_audio_device *adev, int main_mic_on, break; default: - volume = MIXER_ABE_GAIN_0DB; + /* nothing to do */ break; } } |