Reduce log while waiting for comming synthesized pcm data 22/279122/2
authorwn.jang <wn.jang@samsung.com>
Tue, 2 Aug 2022 08:30:40 +0000 (17:30 +0900)
committerwn.jang <wn.jang@samsung.com>
Tue, 2 Aug 2022 08:36:27 +0000 (17:36 +0900)
Change-Id: If6b76a759512d133f5a780b43af63c830428b968

server/ttsd_player.cpp

index 9b1f710..e2aa2e2 100644 (file)
@@ -253,6 +253,7 @@ static int __play_sound_data(PlayerThread* player, unsigned int uid, sound_data_
 
 static void __wait_sound_data(PlayerThread* player, unsigned int uid)
 {
+       ttsd_synthesis_control_e prev_synth_control = TTSD_SYNTHESIS_CONTROL_EXPIRED;
        while (0 >= ttsd_data_get_sound_data_size(uid)) {
                usleep(10000);
                if (false == player->isCurrentUid(uid)) {
@@ -261,13 +262,15 @@ static void __wait_sound_data(PlayerThread* player, unsigned int uid)
 
                /* If engine is not on processing */
                ttsd_synthesis_control_e synth_control = ttsd_data_get_synth_control();
+               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) {
-                       SLOG(LOG_INFO, tts_tag(), "[Server INFO] synth_control(%d)", synth_control);
                        if (AudioStream::AUDIO_STATE_PLAY == g_audio_stream->getState()) {
                                g_audio_stream->unprepareAudioOut();
                                __unset_policy_for_playing();
                        }
                }
+               prev_synth_control = synth_control;
        }
 }