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>
int idx;
/* create a private client context */
- request->context = initAudioCtx();
+ if (!request->context)
+ request->context = initAudioCtx();
_alsa_init("default", request->context);
json_object *jresp;
/* create a private client context */
- request->context = initRadioCtx();
+ if (!request->context)
+ request->context = initRadioCtx();
jresp = json_object_new_object();
json_object_object_add(jresp, "info", json_object_new_string ("Radio initialized"));