diff options
Diffstat (limited to 'binding')
-rw-r--r-- | binding/afm-mediaplayer-binding.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/binding/afm-mediaplayer-binding.c b/binding/afm-mediaplayer-binding.c index 1c2ce6a..b8e2f47 100644 --- a/binding/afm-mediaplayer-binding.c +++ b/binding/afm-mediaplayer-binding.c @@ -552,8 +552,17 @@ static void subscribe(struct afb_req request) afb_req_success(request, NULL, NULL); return; } else if (!strcasecmp(value, "playlist")) { + json_object *jresp = json_object_new_object(); + afb_req_subscribe(request, playlist_event); afb_req_success(request, NULL, NULL); + + pthread_mutex_lock(&mutex); + jresp = populate_json_playlist(jresp); + pthread_mutex_unlock(&mutex); + + afb_event_push(playlist_event, jresp); + return; } |