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
commit0b70d02f01f9426edc7f4a73291c13587fbd064e (patch)
treedd54883a64308dd281ddab835b91f65ee0074f38 /audio
parent2e1542acf6a27004db0e24525720c5745a717c0b (diff)
downloaddevice_samsung_tuna-0b70d02f01f9426edc7f4a73291c13587fbd064e.zip
device_samsung_tuna-0b70d02f01f9426edc7f4a73291c13587fbd064e.tar.gz
device_samsung_tuna-0b70d02f01f9426edc7f4a73291c13587fbd064e.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;
}
}