diff options
author | Fulup Ar Foll <fulup@iot.bzh> | 2017-08-25 01:10:00 +0200 |
---|---|---|
committer | Fulup Ar Foll <fulup@iot.bzh> | 2017-08-25 01:10:00 +0200 |
commit | 7dda5549b51ce1bbf674c620a5715986d7da4ffd (patch) | |
tree | 57b0af6551e55c1207a7d8cbae4fa573fbf85541 /Alsa-afb/Alsa-AddCtl.c | |
parent | b6e3522aae05d770b06d3af7c0cbf71d3a3a447f (diff) |
Fix Initial Volume for Jabra
Diffstat (limited to 'Alsa-afb/Alsa-AddCtl.c')
-rw-r--r-- | Alsa-afb/Alsa-AddCtl.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Alsa-afb/Alsa-AddCtl.c b/Alsa-afb/Alsa-AddCtl.c index b9045f5..aaa9347 100644 --- a/Alsa-afb/Alsa-AddCtl.c +++ b/Alsa-afb/Alsa-AddCtl.c @@ -114,7 +114,7 @@ STATIC json_object * addOneSndCtl(afb_req request, snd_ctl_t *ctlDev, json_objec if (done) ctlType = json_object_get_int(tmpJ); else ctlType = SND_CTL_ELEM_TYPE_INTEGER; - json_object_object_get_ex(ctlJ, "value", &tmpJ); + json_object_object_get_ex(ctlJ, "val", &tmpJ); ctlValue = json_object_get_int(tmpJ); // default for json_object_get_int is zero @@ -162,7 +162,11 @@ STATIC json_object * addOneSndCtl(afb_req request, snd_ctl_t *ctlDev, json_objec snd_ctl_elem_info_get_id(elemInfo, elemId); // If this is a hardware ctl only update value - if (ctlNumid != CTL_AUTO) goto UpdateDefaultVal; + if (ctlNumid != CTL_AUTO) { + json_object_object_get_ex(ctlJ, "val", &tmpJ); + ctlValue = json_object_get_int(tmpJ); + goto UpdateDefaultVal; + } count = snd_ctl_elem_info_get_count(elemInfo); min = (int) snd_ctl_elem_info_get_min(elemInfo); |