return TTS_ERROR_NOT_SUPPORTED;
}
- if (NULL == tts || NULL == credential) {
+ if (NULL == tts) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Input parameter is null");
return TTS_ERROR_INVALID_PARAMETER;
}
client->credential = NULL;
}
- client->credential = strdup(credential);
- if (NULL == client->credential) {
- SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to allocate memory");
- return TTS_ERROR_OUT_OF_MEMORY;
- }
-
client->internal = true;
char* key = NULL;
- if (NULL != credential)
+ if (NULL != credential) {
key = strdup("EnableServerTTS");
- else
+ client->credential = strdup(credential);
+ if (NULL == client->credential) {
+ SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to allocate memory");
+ return TTS_ERROR_OUT_OF_MEMORY;
+ }
+ } else {
key = strdup("DisableServerTTS");
+ }
+
if (NULL == key) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to allocate memory");
return TTS_ERROR_OUT_OF_MEMORY;