aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/alsa/alsa-api-loop.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/alsa/alsa-api-loop.c')
-rw-r--r--plugins/alsa/alsa-api-loop.c13
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;
}