Set a default text size in config parser 40/167940/1
authorsooyeon.kim <sooyeon.kim@samsung.com>
Mon, 6 Nov 2017 05:29:56 +0000 (14:29 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Tue, 23 Jan 2018 05:26:54 +0000 (05:26 +0000)
Change-Id: I35de39a18220e137d5e9e95034b9bd122bfa9286
Signed-off-by: sooyeon.kim <sooyeon.kim@samsung.com>
(cherry picked from commit c65efd9e597e9250e0db5f07e1b0650e26dda5e0)

common/tts_config_parser.c

index 5f40fa9..a042797 100644 (file)
@@ -43,6 +43,7 @@
 #define TTS_TAG_VOICE_TYPE_MALE                "male"
 #define TTS_TAG_VOICE_TYPE_CHILD       "child"
 
+#define TTS_MAX_TEXT_SIZE      2000
 
 extern char* tts_tag();
 
@@ -58,6 +59,7 @@ int tts_parser_get_engine_info(const char* path, tts_engine_info_s** engine_info
                return -1;
        }
 
+       bool isTextsize = false;
        xmlDocPtr doc = NULL;
        xmlNodePtr cur = NULL;
        xmlChar *key = NULL;
@@ -213,6 +215,7 @@ int tts_parser_get_engine_info(const char* path, tts_engine_info_s** engine_info
                                SLOG(LOG_ERROR, tts_tag(), "[ERROR] <%s> has no content", TTS_TAG_ENGINE_PITCH_SUPPORT);
                        }
                } else if (0 == xmlStrcmp(cur->name, (const xmlChar *)TTS_TAG_ENGINE_TEXT_SIZE)) {
+                       isTextsize = true;
                        key = xmlNodeGetContent(cur);
                        if (NULL != key) {
                                temp->text_size = atoi((char*)key);
@@ -225,6 +228,10 @@ int tts_parser_get_engine_info(const char* path, tts_engine_info_s** engine_info
                cur = cur->next;
        }
 
+       if (false == isTextsize) {
+               temp->text_size = TTS_MAX_TEXT_SIZE;
+       }
+
        xmlFreeDoc(doc);
        doc = NULL;