From e5aff5427335422ba8c8487e880e150d15d0cb0b Mon Sep 17 00:00:00 2001 From: Thierry Bultel Date: Mon, 4 Jun 2018 15:23:10 +0200 Subject: Fixed json parsing format errors The expected format did not match the parameters Signed-off-by: Thierry Bultel --- plugins/alsa/alsa-api-loop.c | 4 ++-- plugins/alsa/alsa-api-streams.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/alsa/alsa-api-loop.c b/plugins/alsa/alsa-api-loop.c index 9a746ea..16fe9fc 100644 --- a/plugins/alsa/alsa-api-loop.c +++ b/plugins/alsa/alsa-api-loop.c @@ -50,7 +50,7 @@ PUBLIC AlsaLoopSubdevT *ApiLoopFindSubdev(SoftMixerT *mixer, const char *streamU STATIC AlsaLoopSubdevT *ProcessOneSubdev(SoftMixerT *mixer, AlsaSndLoopT *loop, json_object *subdevJ) { AlsaLoopSubdevT *subdev = calloc(1, sizeof (AlsaPcmCtlT)); - int error = wrap_json_unpack(subdevJ, "{s?s, si,si,s?o !}" + int error = wrap_json_unpack(subdevJ, "{s?s, si,si !}" , "uid", &subdev->uid , "subdev", &subdev->index , "numid", &subdev->numid @@ -202,4 +202,4 @@ PUBLIC int ApiLoopAttach(SoftMixerT *mixer, AFB_ReqT request, const char *uid, j OnErrorExit: return -1; -} \ No newline at end of file +} diff --git a/plugins/alsa/alsa-api-streams.c b/plugins/alsa/alsa-api-streams.c index f531ed5..262553a 100644 --- a/plugins/alsa/alsa-api-streams.c +++ b/plugins/alsa/alsa-api-streams.c @@ -339,10 +339,11 @@ STATIC AlsaStreamAudioT * AttachOneStream(SoftMixerT *mixer, const char *uid, js , "zone", &stream->sink , "source", &stream->source , "volume", &stream->volume - , "mute", stream->mute + , "mute", &stream->mute , "params", ¶msJ , "ramp", &stream->ramp ); + if (error) { AFB_ApiNotice(mixer->api, "ProcessOneStream hal=%s missing 'uid|[info]|zone|source||[volume]|[mute]|[params]' error=%s stream=%s", uid, wrap_json_get_error_string(error), json_object_get_string(streamJ)); goto OnErrorExit; @@ -424,4 +425,4 @@ PUBLIC int ApiStreamAttach(SoftMixerT *mixer, AFB_ReqT request, const char *uid, OnErrorExit: return -1; -} \ No newline at end of file +} -- cgit 1.2.3-korg