summaryrefslogtreecommitdiffstats
path: root/binding/afm-mediaplayer-binding.c
diff options
context:
space:
mode:
authorLoïc Collignon <loic.collignon@iot.bzh>2018-11-23 16:40:05 +0100
committerScott Murray <scott.murray@konsulko.com>2018-12-11 14:17:16 +0000
commita04e0913014e319f7c60e8708824ebe240047882 (patch)
tree08d1bd9fe1efe48e3044487a9c98d65cfb69fc64 /binding/afm-mediaplayer-binding.c
parentbe08bb6ed75e747b540a1b3eace5a32ca0ac955b (diff)
Fix an issue in 4a support due to change in APIv3flounder_6.0.3flounder/6.0.36.0.3
In APIv3 there is a change in the response json from a call to an API. This prevent multimedia to get the right device to play audio on. Bug: SPEC-1974 Change-Id: Iea60421e229a3f24633065b9b81ab4b5c574fcc4 Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh> (cherry picked from commit abb035ab5b74757cd7577f493bc30e7aac0f5227)
Diffstat (limited to 'binding/afm-mediaplayer-binding.c')
-rw-r--r--binding/afm-mediaplayer-binding.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/binding/afm-mediaplayer-binding.c b/binding/afm-mediaplayer-binding.c
index 8a60541..049fb2d 100644
--- a/binding/afm-mediaplayer-binding.c
+++ b/binding/afm-mediaplayer-binding.c
@@ -820,23 +820,18 @@ static void gstreamer_init(afb_api_t api)
ret = afb_api_call_sync(api, "ahl-4a", "multimedia", jsonData, &response, NULL, NULL);
if (!ret) {
- json_object *valJson = NULL;
json_object *val = NULL;
gboolean ret;
- ret = json_object_object_get_ex(response, "response", &valJson);
+ ret = json_object_object_get_ex(response, "device_uri", &val);
if (ret) {
- ret = json_object_object_get_ex(valJson, "device_uri", &val);
- if (ret) {
- char* jres_pcm = json_object_get_string(val);
- g_object_set(data.alsa_sink, "device", jres_pcm, NULL);
- AFB_DEBUG("GSTREAMER alsa_sink.device = \"%s\"", jres_pcm);
- }
- ret = json_object_object_get_ex(valJson, "stream_id", &val);
- if (ret) {
- int stream_id = json_object_get_int(val);
- }
+ char* jres_pcm = json_object_get_string(val);
+ g_object_set(data.alsa_sink, "device", jres_pcm, NULL);
+ AFB_DEBUG("GSTREAMER alsa_sink.device = \"%s\"", jres_pcm);
}
}
+ else {
+ AFB_ERROR("GSTREAMER Failed to call ahl-4a/multimedia!");
+ }
#endif
g_object_set(data.playbin, "audio-sink", data.fake_sink, NULL);