Merge "Fix crash when player_focus_state_cb is called" into tizen accepted/tizen/unified/20170810.171958 submit/tizen/20170809.104341
authorSooyeon Kim <sooyeon.kim@samsung.com>
Mon, 7 Aug 2017 02:42:06 +0000 (02:42 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Mon, 7 Aug 2017 02:42:06 +0000 (02:42 +0000)
1  2 
server/ttsd_player.c

diff --combined server/ttsd_player.c
@@@ -98,7 -98,7 +98,7 @@@ player_s* __player_get_item(int uid
  void __player_focus_state_cb(sound_stream_info_h stream_info, sound_stream_focus_mask_e focus_mask, sound_stream_focus_state_e focus_state,
                                                        sound_stream_focus_change_reason_e reason_for_change, int sound_behavior, const char *extra_info, void *user_data)
  {
 -      SLOG(LOG_DEBUG, tts_tag(), "===== Focus state changed cb");
 +      SLOG(LOG_DEBUG, tts_tag(), "@@@ Focus state changed cb");
  
        if (stream_info != g_stream_info_h) {
                SLOG(LOG_ERROR, tts_tag(), "[Player ERROR] Invalid stream info handle");
                                        return;
                                }
  
-                               g_playing_info->state = APP_STATE_PAUSED;
                                ttsd_data_set_client_state(uid, APP_STATE_PAUSED);
                                int pid = ttsd_data_get_pid(uid);
                                /* send message to client about changing state */
                }
        }
  
 -      SLOG(LOG_DEBUG, tts_tag(), "=====");
 -      SLOG(LOG_DEBUG, tts_tag(), "");
 +      SLOG(LOG_DEBUG, tts_tag(), "@@@");
  
        return;
  }
@@@ -195,7 -195,7 +194,7 @@@ static int __destroy_audio_out(
  
  static void __end_play_thread(void *data, Ecore_Thread *thread)
  {
 -      SLOG(LOG_ERROR, tts_tag(), "===== End thread");
 +      SLOG(LOG_ERROR, tts_tag(), "@@@ End thread");
  }
  
  static void __set_policy_for_playing(int volume)
@@@ -240,7 -240,7 +239,7 @@@ static void __unset_policy_for_playing(
  
  static void __play_thread(void *data, Ecore_Thread *thread)
  {
 -      SLOG(LOG_DEBUG, tts_tag(), "===== Start thread");
 +      SLOG(LOG_DEBUG, tts_tag(), "@@@ Start thread");
  
        if (NULL == g_playing_info) {
                SLOG(LOG_ERROR, tts_tag(), "[Player ERROR] No current player");
@@@ -646,9 -646,9 +645,9 @@@ int ttsd_player_release(void
  
        int ret;
  
 -      SLOG(LOG_DEBUG, tts_tag(), "[Player DEBUG] ==========================");
 +      SLOG(LOG_DEBUG, tts_tag(), "[Player DEBUG] @@@@@");
        SLOG(LOG_DEBUG, tts_tag(), "[Player DEBUG] Active thread count : %d", ecore_thread_active_get());
 -      SLOG(LOG_DEBUG, tts_tag(), "[Player DEBUG] ==========================");
 +      SLOG(LOG_DEBUG, tts_tag(), "[Player DEBUG] @@@@@");
  
        /* The thread should be released */
        int thread_count = ecore_thread_active_get();
@@@ -859,9 -859,9 +858,9 @@@ int ttsd_player_stop(int uid
        current->idx = 0;
  
        if (NULL == g_playing_info) {
 -              SLOG(LOG_DEBUG, tts_tag(), "[Player] ==========================");
 +              SLOG(LOG_DEBUG, tts_tag(), "[Player] @@@@@");
                SLOG(LOG_ERROR, tts_tag(), "[Player] Active thread count : %d", ecore_thread_active_get());
 -              SLOG(LOG_DEBUG, tts_tag(), "[Player] ==========================");
 +              SLOG(LOG_DEBUG, tts_tag(), "[Player] @@@@@");
  
                /* The thread should be released */
                int thread_count = ecore_thread_active_get();
                        thread_count = ecore_thread_active_get();
                }
  
 -              SLOG(LOG_DEBUG, tts_tag(), "[Player] ==========================");
 +              SLOG(LOG_DEBUG, tts_tag(), "[Player] @@@@@");
                SLOG(LOG_ERROR, tts_tag(), "[Player] Active thread count : %d", ecore_thread_active_get());
 -              SLOG(LOG_DEBUG, tts_tag(), "[Player] ==========================");
 +              SLOG(LOG_DEBUG, tts_tag(), "[Player] @@@@@");
        }
  
        SLOG(LOG_INFO, tts_tag(), "[Player SUCCESS] Stop player : uid(%d)", uid);
@@@ -953,10 -953,10 +952,10 @@@ int ttsd_player_pause(int uid
        }
  
        current->state = APP_STATE_PAUSED;
 -      
 -      SLOG(LOG_DEBUG, tts_tag(), "[Player] ==========================");
 +
 +      SLOG(LOG_DEBUG, tts_tag(), "[Player] @@@@@");
        SLOG(LOG_ERROR, tts_tag(), "[Player] Active thread count : %d", ecore_thread_active_get());
 -      SLOG(LOG_DEBUG, tts_tag(), "[Player] ==========================");
 +      SLOG(LOG_DEBUG, tts_tag(), "[Player] @@@@@");
  
        /* The thread should be released */
        int thread_count = ecore_thread_active_get();
                thread_count = ecore_thread_active_get();
        }
  
 -      SLOG(LOG_DEBUG, tts_tag(), "[Player] ==========================");
 +      SLOG(LOG_DEBUG, tts_tag(), "[Player] @@@@@");
        SLOG(LOG_ERROR, tts_tag(), "[Player] Active thread count : %d", ecore_thread_active_get());
 -      SLOG(LOG_DEBUG, tts_tag(), "[Player] ==========================");
 +      SLOG(LOG_DEBUG, tts_tag(), "[Player] @@@@@");
  
        SLOG(LOG_DEBUG, tts_tag(), "[Player SUCCESS] Pause player : uid(%d)", uid);