Manage the state of AudioStream and Change the condition to call unprepareAudioOut 17/325217/1
authorVBS <sooyeon.kim@samsung.com>
Wed, 4 Jun 2025 13:11:37 +0000 (22:11 +0900)
committerVBS <sooyeon.kim@samsung.com>
Wed, 4 Jun 2025 13:11:37 +0000 (22:11 +0900)
Change-Id: Ia7a06cf05c6d892d4b8c8ca5d281f989b2fb6d41
Signed-off-by: VBS <sooyeon.kim@samsung.com>
server/AudioStream.cpp
server/ttsd_player.cpp

index 0b59ca60383e45d192e1aafb06bab479b2f5024a..3fecd524aeb603c023e0a14e3d1b1c9081f663eb 100644 (file)
@@ -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;
        }
 
index edd09c1aaa5bdbf9223759d69f942da86d199405..b93b22924ec50bcd0a430af36b85880e79d27bf3 100644 (file)
@@ -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
                        }