Set a default text size in config parser
[platform/core/uifw/tts.git] / 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;