Fix wrong condition for parameter checker 95/291495/1
authorSuyeon Hwang <stom.hwang@samsung.com>
Mon, 17 Apr 2023 11:26:10 +0000 (20:26 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Mon, 17 Apr 2023 11:26:10 +0000 (20:26 +0900)
- Issue:
tts_set_playing_mode() always returns invalid parameter error.

- Solution:
This patch fixes the condition for parameter checker in
tts_set_playing_mode(). Previous condition statement always returns
true, so the function works wrong. Through this patch, the function will
properly check the paramter.

Change-Id: I2fdb5254f942f6e9c1c1741e241bcfc32fe4cbdf
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
client/tts.c

index 46de738..191d2d4 100644 (file)
@@ -436,7 +436,7 @@ int tts_set_playing_mode(tts_h tts, tts_playing_mode_e mode)
 
        SLOG(LOG_INFO, TAG_TTSC, "@@@ Set TTS playing mode(%d)", mode);
 
-       RETVM_IF(TTS_PLAYING_MODE_BY_CLIENT > mode || TTS_PLAYING_MODE_BY_SERVICE < mode, TTS_ERROR_INVALID_PARAMETER, "[ERROR] mode is not valid : %d", mode);
+       RETVM_IF(TTS_PLAYING_MODE_BY_SERVICE > mode || TTS_PLAYING_MODE_BY_CLIENT < mode, TTS_ERROR_INVALID_PARAMETER, "[ERROR] mode is not valid : %d", mode);
 
        tts_client_s* client = tts_client_get(tts);
        RETVM_IF(NULL == client, TTS_ERROR_INVALID_PARAMETER, "[ERROR] A handle is not valid. tts(%p)", tts);