summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan-Simon Moeller <jsmoeller@linuxfoundation.org>2019-09-16 11:35:11 +0000
committerGerrit Code Review <gerrit@automotivelinux.org>2019-09-16 11:35:11 +0000
commit0613280f679b359e8ce0e5aba42d4c3757775939 (patch)
tree5d861540114a33ed90da6d2a6e90c776498d361c
parentde9a178a7562ec7a07565e3a4fdcfcc7e1dea31d (diff)
parente4dc7b7d0fc0d85dcb1dddc2c1e106b0beb8fe79 (diff)
Merge "mediaplayer: report metadata on playlist events and subscription"icefish_8.99.2icefish_8.99.1icefish/8.99.2icefish/8.99.18.99.28.99.1
-rw-r--r--binding/afm-mediaplayer-binding.c10
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)