summaryrefslogtreecommitdiffstats
path: root/binding/afm-mediaplayer-binding.c
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2018-12-19 23:12:19 -0800
committerMatt Ranostay <matt.ranostay@konsulko.com>2018-12-19 23:50:42 -0800
commitf74ed95f027448111adad1162ac277cc297d770e (patch)
tree58158a0a7fee2f66a9870fdf880cc9820fe3a587 /binding/afm-mediaplayer-binding.c
parenta9f63b6b5f455e2957ed08e2bb2b581c058035ff (diff)
binding: mediaplayer: fix segfault without playlist and A2DP connectedflounder_6.0.5flounder_6.0.4flounder/6.0.5flounder/6.0.46.0.56.0.4flounder
A2DP connection and events with no local media playlist will result in segfaults. Change-Id: I8034d5ae88d2f81ffd74263800c32ded0645d4d8 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'binding/afm-mediaplayer-binding.c')
-rw-r--r--binding/afm-mediaplayer-binding.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/binding/afm-mediaplayer-binding.c b/binding/afm-mediaplayer-binding.c
index 960749c..98887c1 100644
--- a/binding/afm-mediaplayer-binding.c
+++ b/binding/afm-mediaplayer-binding.c
@@ -967,6 +967,10 @@ static void onevent(afb_api_t api, const char *event, struct json_object *object
mediaplayer_set_role_state(api, GST_STATE_PAUSED);
} else {
json_object *jresp = populate_json_metadata();
+
+ if (!jresp)
+ jresp = json_object_new_object();
+
json_object_object_add(jresp, "status",
json_object_new_string("stopped"));
afb_event_push(metadata_event, jresp);