diff options
Diffstat (limited to 'audio/audio_hw.c')
-rw-r--r-- | audio/audio_hw.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c index 56b3e141..3fdf3f97 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -42,7 +42,6 @@ #include <audio_effects/effect_aec.h> #include <sys/ioctl.h> -#include <linux/audio_hifi.h> #define CARD_OUT 0 #define PORT_CODEC 0 @@ -362,12 +361,16 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) struct alsa_audio_device *adev = out->dev; struct str_parms *parms; char value[32]; - int ret, val = 0; + int val = 0; + int ret = -EINVAL; + + if (kvpairs == NULL || kvpairs[0] == 0) { + return 0; + } parms = str_parms_create_str(kvpairs); - ret = str_parms_get_str(parms, AUDIO_PARAMETER_STREAM_ROUTING, value, sizeof(value)); - if (ret >= 0) { + if (str_parms_get_str(parms, AUDIO_PARAMETER_STREAM_ROUTING, value, sizeof(value)) >= 0) { val = atoi(value); pthread_mutex_lock(&adev->lock); pthread_mutex_lock(&out->lock); @@ -377,6 +380,7 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) } pthread_mutex_unlock(&out->lock); pthread_mutex_unlock(&adev->lock); + ret = 0; } str_parms_destroy(parms); |