From 067d752fd7f7dfaa73dadf3bb9e2f76cf8ff1b1e Mon Sep 17 00:00:00 2001 From: Chris Kelly Date: Fri, 29 Jul 2011 22:37:00 -0500 Subject: audio: correct output set parameters Change-Id: I90c957ce7436b52d2aa4339b21d91921e9e612ad Signed-off-by: Chris Kelly --- audio/audio_hw.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'audio') diff --git a/audio/audio_hw.c b/audio/audio_hw.c index b5c015f..b253cb2 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -620,15 +620,16 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) struct str_parms *parms; char *str; char value[32]; - int ret; + int ret, val = 0; parms = str_parms_create_str(kvpairs); pthread_mutex_lock(&adev->lock); ret = str_parms_get_str(parms, AUDIO_PARAMETER_STREAM_ROUTING, value, sizeof(value)); if (ret >= 0) { - if (adev->out_device != atoi(value)) { - adev->out_device = atoi(value); + val = atoi(value); + if ((adev->out_device != val) && (val != 0)) { + adev->out_device = val; out_standby(stream); select_output_device(adev); } -- cgit v1.1