From 7bf07b5b39e7385c06ffa34c313932625fcb1b12 Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Sat, 5 Jul 2014 00:36:45 +0200 Subject: [PATCH] Audio-RIL-Interface: Keep up with libsrs-client Signed-off-by: Paul Kocialkowski --- audio-ril-interface/audio-ril-interface.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/audio-ril-interface/audio-ril-interface.c b/audio-ril-interface/audio-ril-interface.c index cbec73c..9ba2d0c 100644 --- a/audio-ril-interface/audio-ril-interface.c +++ b/audio-ril-interface/audio-ril-interface.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Paul Kocialkowski + * Copyright (C) 2013-2014 Paul Kocialkowski * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,7 +34,7 @@ int galaxys2_mic_mute(void *pdata, int mute) int galaxys2_voice_volume(void *pdata, audio_devices_t device, float volume) { struct srs_client *client = NULL; - struct srs_snd_call_volume call_volume; + struct srs_snd_call_volume_data call_volume; int rc; ALOGD("%s(%d, %f)", __func__, device, volume); @@ -80,7 +80,7 @@ int galaxys2_voice_volume(void *pdata, audio_devices_t device, float volume) int galaxys2_route(void *pdata, audio_devices_t device) { struct srs_client *client; - struct srs_snd_call_audio_path call_audio_path; + struct srs_snd_call_audio_path_data call_audio_path; int rc; ALOGD("%s(%d)", __func__, device); @@ -143,9 +143,11 @@ struct audio_ril_interface *audio_ril_interface_open(void) ALOGD("%s()", __func__); - signal(SIGPIPE, SIG_IGN); - - srs_client_create(&client); + client = srs_client_create(); + if (client == NULL) { + ALOGE("%s: Failed to create SRS client", __func__); + return NULL; + } rc = srs_client_open(client); if (rc < 0) { @@ -153,9 +155,9 @@ struct audio_ril_interface *audio_ril_interface_open(void) return NULL; } - rc = srs_client_ping(client); + rc = srs_ping(client); if (rc < 0) - ALOGE("%s: Failed to ping SRS client", __func__); + ALOGE("%s: Failed to ping SRS", __func__); galaxys2_interface.pdata = (void *) client; @@ -178,5 +180,7 @@ void audio_ril_interface_close(struct audio_ril_interface *interface) if (rc < 0) ALOGE("%s: Failed to close SRS client", __func__); - srs_client_destroy(client); + rc = srs_client_destroy(client); + if (rc < 0) + ALOGE("%s: Failed to destroy SRS client", __func__); }