diff options
author | Thierry Bultel <thierry.bultel@iot.bzh> | 2019-05-13 14:30:01 +0200 |
---|---|---|
committer | Thierry Bultel <thierry.bultel@iot.bzh> | 2019-05-14 15:14:20 +0200 |
commit | b5206132b6fb5b060acacaf2aee45841a7792a8c (patch) | |
tree | ef69b33d17629f6eddd249eadc7f2c446557620a /plugins/alsa/alsa-api-loop.c | |
parent | 6c627f8650b88b19704dd4e513fe7fff701c00c1 (diff) | |
parent | 43df82896d8535f99233b4d3ab35a744b07871e0 (diff) |
Merge branch 'sandbox/tbultel/spec-2387' into guppyguppy_7.0.4guppy_7.0.3guppy_7.0.2guppy/7.0.4guppy/7.0.3guppy/7.0.27.0.47.0.37.0.2guppy
Bug AGL: SPEC-2387
This brings the following commits from master:
* 43df828 loops/avirt: forget saved loops after creation
* 622096c plug route: added a calculation for the number of physical c..
* c950295 streams: improved log output
* 7520fbf core-pcm: fixed channels setting issues
* 293fe69 core pcm: use the same model for writing and reading audio
* e355716 pcm plugs: rework the alsa config cleanup
* eb45566 alsa-api-pcm: added an 'optional' parameter
* 93bf6e6 alsa-transaction: simplify the cleanup
* bb70b48 alsa-api-pcm: added support of quirks
* 93ca785 alsa-utils-dump: added missing ending null char
Change-Id: I8ccc641b1f6827873e479185c0098d732d1b2b0a
Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
Diffstat (limited to 'plugins/alsa/alsa-api-loop.c')
-rw-r--r-- | plugins/alsa/alsa-api-loop.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins/alsa/alsa-api-loop.c b/plugins/alsa/alsa-api-loop.c index 7e852a8..a4b19f5 100644 --- a/plugins/alsa/alsa-api-loop.c +++ b/plugins/alsa/alsa-api-loop.c @@ -117,7 +117,7 @@ STATIC int CheckOneSubdev(SoftMixerT *mixer, AlsaSndLoopT *loop, AlsaLoopSubdevT pcmCtl->closeAtDeletion = true; // free PCM as we only open loop to assert it's a valid capture device - AlsaMixerTransactionObjectForget(mixer->transaction, pcmCtl); + AlsaMixerTransactionObjectDelete(mixer->transaction, pcmCtl, false); AlsaPcmCtlDelete(mixer, pcmCtl); return 0; @@ -445,10 +445,12 @@ PUBLIC int ApiLoopAttach(SoftMixerT *mixer, AFB_ReqT request, const char * uid, AlsaSndLoopT * newLoop = NULL; + AFB_API_INFO(mixer->api, "%s: %s", __func__, json_object_get_string(argsJ)); + if (mixer->nbLoops >= mixer->max.loops) { - AFB_IfReqFailF(mixer, request, "too-small", "mixer=%s hal=%s max loop=%d", mixer->uid, uid, mixer->max.loops); + AFB_IfReqFailF(mixer, request, "too many loops", "mixer=%s hal=%s max loop=%d", mixer->uid, uid, mixer->max.loops); goto fail; - } + } switch (json_object_get_type(argsJ)) { size_t count; @@ -464,14 +466,14 @@ PUBLIC int ApiLoopAttach(SoftMixerT *mixer, AFB_ReqT request, const char * uid, count = json_object_array_length(argsJ); if (count > (mixer->max.loops - mixer->nbLoops)) { AFB_IfReqFailF(mixer, request, "too-small", "mixer=%s hal=%s max loop=%d", mixer->uid, uid, mixer->max.loops); - goto fail_loop; + goto fail; } for (int idx = 0; idx < count; idx++) { json_object *loopJ = json_object_array_get_idx(argsJ, idx); newLoop = loopCreate(mixer, uid, loopJ, streamsJ); if (newLoop == NULL) { - goto fail_loop; + goto fail; } } break; @@ -482,7 +484,6 @@ PUBLIC int ApiLoopAttach(SoftMixerT *mixer, AFB_ReqT request, const char * uid, return 0; -fail_loop: fail: return -1; } |