Merge "hal: reset default parameters when ignoring non-existing USB sound card"
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index ded16ca..bd6dad5 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -7461,6 +7461,12 @@
devices = AUDIO_DEVICE_OUT_SPEAKER;
ALOGW("%s: ignore set device to non existing USB card, use output device(%#x)",
__func__, devices);
+ if (config->format == AUDIO_FORMAT_DEFAULT)
+ config->format = AUDIO_FORMAT_PCM_16_BIT;
+ if (config->sample_rate == 0)
+ config->sample_rate = DEFAULT_OUTPUT_SAMPLING_RATE;
+ if (config->channel_mask == AUDIO_CHANNEL_NONE)
+ config->channel_mask = AUDIO_CHANNEL_OUT_STEREO;
}
*stream_out = NULL;