From e574d44d00780f2c7010677a6c261ffba82ea83f Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Thu, 12 Sep 2013 13:07:33 -0500 Subject: handsfree-audio: Tweak logic a bit --- src/handsfree-audio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c index c311b04c..adb8f73d 100644 --- a/src/handsfree-audio.c +++ b/src/handsfree-audio.c @@ -82,13 +82,13 @@ static ofono_bool_t apply_settings_from_codec(int fd, uint8_t codec) { struct bt_voice voice; - /* CVSD is the default, no need to set BT_VOICE. */ - if (codec == HFP_CODEC_CVSD) - return TRUE; - memset(&voice, 0, sizeof(voice)); voice.setting = codec2setting(codec); + /* CVSD is the default, no need to set BT_VOICE. */ + if (voice.setting == BT_VOICE_CVSD_16BIT) + return TRUE; + if (setsockopt(fd, SOL_BLUETOOTH, BT_VOICE, &voice, sizeof(voice)) < 0) return FALSE; -- cgit v1.2.3