aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/audio
diff options
context:
space:
mode:
authorManuel Bachmann <manuel.bachmann@iot.bzh>2016-01-06 13:56:00 +0100
committerManuel Bachmann <manuel.bachmann@iot.bzh>2016-01-06 13:56:00 +0100
commita10fa6960df758dcfcb406dcee6383be5d494187 (patch)
tree676f64010ba300119031fae2c355cf142fec4218 /plugins/audio
parent12686e3f00eb942bf587e99f80654400cc6995b6 (diff)
Fix Audio/Radio reinitialization issue
Audio and Radio plugins init() functions were re-creating a new client context each time, but it is actually unwanted as afb-radio <TokenRefresh> widgets uses this function to initialize AND refresh the context. Signed-off-by: Manuel Bachmann <manuel.bachmann@iot.bzh>
Diffstat (limited to 'plugins/audio')
-rw-r--r--plugins/audio/audio-api.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/audio/audio-api.c b/plugins/audio/audio-api.c
index 3877ce5b..8350377d 100644
--- a/plugins/audio/audio-api.c
+++ b/plugins/audio/audio-api.c
@@ -64,7 +64,8 @@ STATIC json_object* init (AFB_request *request) { /* AFB_SESSION_CHECK */
int idx;
/* create a private client context */
- request->context = initAudioCtx();
+ if (!request->context)
+ request->context = initAudioCtx();
_alsa_init("default", request->context);