diff options
Diffstat (limited to 'ahl-binding/ahl-config.c')
-rw-r--r-- | ahl-binding/ahl-config.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/ahl-binding/ahl-config.c b/ahl-binding/ahl-config.c index 2a61b5e..c60cb9c 100644 --- a/ahl-binding/ahl-config.c +++ b/ahl-binding/ahl-config.c @@ -14,7 +14,6 @@ * limitations under the License. */ -#define _GNU_SOURCE #include <stdio.h> #include <string.h> #include <json-c/json.h> @@ -85,7 +84,7 @@ static char* CtlConfigSearch(const char *dirList, const char *prefix) { int ParseHLBConfig() { char * versionStr = NULL; - json_object * jAudioRoles = NULL; + json_object * jAudioRoles = NUL L; json_object * jHALList = NULL; char * policyModule = NULL; @@ -105,13 +104,13 @@ int ParseHLBConfig() { if(config_JFile == NULL) { AFB_ERROR("Error: Can't open configuration file -> %s",configfile_path); - return 1; + return AHL_FAIL; } int err = wrap_json_unpack(config_JFile, "{s:s,s:s,s:o,s:o}", "version", &versionStr,"policy_module", &policyModule,"audio_roles",&jAudioRoles,"hal_list",&jHALList); if (err) { AFB_ERROR("Invalid configuration file -> %s", configfile_path); - return 1; + return AHL_FAIL; } AFB_INFO("High-level audio API version: %s", "1.0.0"); AFB_INFO("Config version: %s", versionStr); @@ -136,7 +135,7 @@ int ParseHLBConfig() { if( err != 0 ) { AFB_ERROR("Audio high level API could not set dependency on API: %s",pHAL); - return 1; + return AHL_FAIL; } } } @@ -165,7 +164,7 @@ int ParseHLBConfig() { ); if (err) { AFB_ERROR("Invalid audio role configuration : %s", json_object_to_json_string(jAudioRole)); - return 1; + return AHL_FAIL; } if (jOutputDevices) @@ -198,7 +197,7 @@ int ParseHLBConfig() { err = EnumerateDevices(jInputDevices,pRoleName,ENDPOINTTYPE_SOURCE,pRoleInfo->pSourceEndpoints); if (err) { AFB_ERROR("Invalid input devices : %s", json_object_to_json_string(jInputDevices)); - return 1; + return AHL_FAIL; } } // Sinks @@ -207,15 +206,14 @@ int ParseHLBConfig() { err = EnumerateDevices(jOutputDevices,pRoleName,ENDPOINTTYPE_SINK,pRoleInfo->pSinkEndpoints); if (err) { AFB_ERROR("Invalid output devices : %s", json_object_to_json_string(jOutputDevices)); - return 1; + return AHL_FAIL; } } g_hash_table_insert(g_AHLCtx.policyCtx.pRoleInfo, pRoleInfo->pRoleName, pRoleInfo); - } // Build lists of all device URI referenced in config file (input/output) AFB_DEBUG ("Audio high-level - Parse high-level audio configuration done"); - return 0; + return AHL_SUCCESS; } |