From: VBS Date: Wed, 4 Jun 2025 13:11:37 +0000 (+0900) Subject: Manage the state of AudioStream and Change the condition to call unprepareAudioOut X-Git-Tag: accepted/tizen/7.0/unified/20250610.091116~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cc04b90e2cf8b010a724bb9358008a49574ef78d;p=platform%2Fcore%2Fuifw%2Ftts.git Manage the state of AudioStream and Change the condition to call unprepareAudioOut Change-Id: Ia7a06cf05c6d892d4b8c8ca5d281f989b2fb6d41 Signed-off-by: VBS --- diff --git a/server/AudioStream.cpp b/server/AudioStream.cpp index 0b59ca60..3fecd524 100644 --- a/server/AudioStream.cpp +++ b/server/AudioStream.cpp @@ -170,6 +170,7 @@ int AudioStream::prepareAudioOut() { if (__prepared) { SLOG(LOG_DEBUG, tts_tag(), "[AudioStream] Audio is already prepared"); + __state = AUDIO_STATE_PLAY; return TTSD_ERROR_NONE; } diff --git a/server/ttsd_player.cpp b/server/ttsd_player.cpp index edd09c1a..b93b2292 100644 --- a/server/ttsd_player.cpp +++ b/server/ttsd_player.cpp @@ -288,7 +288,7 @@ static void __wait_sound_data(PlayerThread* player, unsigned int uid) if (prev_synth_control != synth_control) SLOG(LOG_INFO, tts_tag(), "[Server INFO] prev_synth_control(%d), synth_control(%d)", prev_synth_control, synth_control); if (TTSD_SYNTHESIS_CONTROL_DOING != synth_control) { - if (AudioStream::AUDIO_STATE_PLAY == g_audio_stream->getState()) { + if (AudioStream::AUDIO_STATE_PLAY == g_audio_stream->getState() || AudioStream::AUDIO_STATE_WAIT_FOR_PLAYING == g_audio_stream->getState()) { g_audio_stream->unprepareAudioOut(); __unset_policy_for_playing(uid); // uid == current uid }