summaryrefslogtreecommitdiffstats
path: root/plugins/alsa/alsa-api-mixer.c
diff options
context:
space:
mode:
authorThierry Bultel <thierry.bultel@iot.bzh>2019-02-20 12:24:41 +0100
committerThierry Bultel <thierry.bultel@iot.bzh>2019-02-20 12:24:41 +0100
commit943f34b1d319e0ddc157dcfd85acde628f9d2ead (patch)
tree6b517f4aa6cee3e7adf3bd2cc895bfae0440262d /plugins/alsa/alsa-api-mixer.c
parentd31ba2476fca9396e255fefd3b216befb8a7f316 (diff)
loops/avirt: forget saved loops after creation
avirt needs a backup of loops, before creating the streams. However, this breaks software dynamic streams such as those of of type bluez-alsa, because the logic was re-calling the loop creation at each call of the 'attach' verb. The fix simply consists in forgetting the saved loops once they are created Change-Id: I63f492b89233bed12de583de6e1077ac1c9c3ccf Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
Diffstat (limited to 'plugins/alsa/alsa-api-mixer.c')
-rw-r--r--plugins/alsa/alsa-api-mixer.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/plugins/alsa/alsa-api-mixer.c b/plugins/alsa/alsa-api-mixer.c
index bc27e24..16b05ff 100644
--- a/plugins/alsa/alsa-api-mixer.c
+++ b/plugins/alsa/alsa-api-mixer.c
@@ -614,13 +614,16 @@ STATIC void MixerAttachVerb(afb_req_t request) {
// In AVIRT mode, we require both the loops and streams JSON objects to
// construct the loopbacks, so when the loops are set, but the streams
// are not, we need to save the loops until the streams are given to us
- if (streamsJ && (loopsJ || LoopsJ)) {
- AFB_API_INFO(mixer->api, "%s set LOOPS/AVIRT", __func__);
- error = ApiLoopAttach(mixer, request, uid,
- ((loopsJ) ? loopsJ : LoopsJ), streamsJ);
- if (error)
- goto fail;
- }
+ if (streamsJ && (loopsJ || LoopsJ)) {
+ AFB_API_INFO(mixer->api, "%s set LOOPS/AVIRT", __func__);
+ error = ApiLoopAttach(mixer, request, uid, ((loopsJ) ? loopsJ : LoopsJ), streamsJ);
+ if (error) {
+ goto fail;
+ }
+ // Now, forget the saved LoopsJ
+ if (LoopsJ)
+ LoopsJ = NULL;
+ }
AFB_API_INFO(mixer->api, "%s set RAMPS", __func__);