summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorSimon Wilson <simonwilson@google.com>2011-08-26 16:09:34 -0700
committerSimon Wilson <simonwilson@google.com>2011-08-26 16:09:34 -0700
commit8e0348cccfd6d4a7b22626a14228af7685249c59 (patch)
treea49b4a8a339d2f665875c3081b3cf28936dd57da /audio
parent36355108382c674eebf12769e16f5ef8c6b8bf1c (diff)
downloaddevice_samsung_tuna-8e0348cccfd6d4a7b22626a14228af7685249c59.zip
device_samsung_tuna-8e0348cccfd6d4a7b22626a14228af7685249c59.tar.gz
device_samsung_tuna-8e0348cccfd6d4a7b22626a14228af7685249c59.tar.bz2
audio: check for active_input != NULL before following
Fixes bug 5223164 Change-Id: I95557589b6d17df96de4235e8003157c6324917a
Diffstat (limited to 'audio')
-rw-r--r--audio/audio_hw.c6
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;
}
}