aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Hillenbrand <daniel.hillenbrand@codeworkx.de>2012-07-26 02:33:17 +0200
committerDaniel Hillenbrand <daniel.hillenbrand@codeworkx.de>2012-07-26 02:33:17 +0200
commit4ba88df00b5aff85fcac4e0d03bc0c99f37b4de0 (patch)
treeecc84bd05236ac38a7ef8274ce3c13aab3b5506f
parent3113d3f4c11ac1635948eaed09e70838890ff358 (diff)
downloaddevice_samsung_espresso3g-4ba88df00b5aff85fcac4e0d03bc0c99f37b4de0.zip
device_samsung_espresso3g-4ba88df00b5aff85fcac4e0d03bc0c99f37b4de0.tar.gz
device_samsung_espresso3g-4ba88df00b5aff85fcac4e0d03bc0c99f37b4de0.tar.bz2
audio: request 2 input channels by default
-rwxr-xr-xaudio/audio_hw.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index 8e26217..e861fc6 100755
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -1407,7 +1407,7 @@ static uint32_t in_get_channels(const struct audio_stream *stream)
{
struct espresso_stream_in *in = (struct espresso_stream_in *)stream;
- return in->main_channels;
+ return AUDIO_CHANNEL_IN_STEREO;
}
static audio_format_t in_get_format(const struct audio_stream *stream)
@@ -2569,6 +2569,13 @@ static int adev_open_input_stream(struct audio_hw_device *dev,
struct espresso_audio_device *ladev = (struct espresso_audio_device *)dev;
struct espresso_stream_in *in;
int ret;
+
+ /* Respond with a request for stereo if a different format is given. */
+ if (config->channel_mask != AUDIO_CHANNEL_IN_STEREO) {
+ config->channel_mask = AUDIO_CHANNEL_IN_STEREO;
+ return -EINVAL;
+ }
+
int channel_count = popcount(config->channel_mask);
*stream_in = NULL;