summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Collignon <loic.collignon@iot.bzh>2018-11-23 16:40:05 +0100
committerLoïc Collignon <loic.collignon@iot.bzh>2018-11-23 16:40:05 +0100
commitabb035ab5b74757cd7577f493bc30e7aac0f5227 (patch)
tree430574c55be1b59c9b33bad00e53d4e7cadbf6ae
parent1dfafa70bdaccff3bc9fe72ef02b4b2646963de3 (diff)
Fix an issue in 4a support due to change in APIv3guppy_6.99.2guppy_6.99.1guppy/6.99.2guppy/6.99.16.99.26.99.1
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>
-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);