diff options
author | Matt Ranostay <matt.ranostay@konsulko.com> | 2019-09-12 23:34:20 -0700 |
---|---|---|
committer | Matt Ranostay <matt.ranostay@konsulko.com> | 2019-09-15 07:30:28 +0000 |
commit | d483d6cb88853a49332a2cd67d7478ab19e1fdf9 (patch) | |
tree | 43783185992ae42f0b539ce756a2ea852a154ec2 /binding/afm-mediaplayer-binding.c | |
parent | 42872410a9f13c5bae877a7290caf4a5ff5f34a5 (diff) |
mediaplayer: report metadata on playlist events and subscriptionhalibut_8.0.3halibut_8.0.2halibut/8.0.3halibut/8.0.28.0.38.0.2
Report metadata on initial metadata event subsciption, and also
when the playlist changes.
Bug-AGL: SPEC-2774
Change-Id: Ieb68d6d5e53af889ad66c52887023b8c94c40080
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'binding/afm-mediaplayer-binding.c')
-rw-r--r-- | binding/afm-mediaplayer-binding.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/binding/afm-mediaplayer-binding.c b/binding/afm-mediaplayer-binding.c index a7510f1..14a4fa1 100644 --- a/binding/afm-mediaplayer-binding.c +++ b/binding/afm-mediaplayer-binding.c @@ -653,6 +653,8 @@ static json_object *populate_json_metadata(void) json_object_object_add(jresp, "volume", json_object_new_int64(data.volume)); + json_object_object_add(jresp, "track", metadata); + return jresp; } @@ -999,6 +1001,14 @@ static void onevent(afb_api_t api, const char *event, struct json_object *object g_mutex_unlock(&mutex); afb_event_push(playlist_event, jresp); + + // send metadata out after event + g_mutex_lock(&mutex); + jresp = populate_json_metadata(); + g_mutex_unlock(&mutex); + + if (jresp) + afb_event_push(metadata_event, jresp); } void *gstreamer_loop_thread(void *ptr) |