static int earjack_conn_changed_cb_id;
+
+static void vp_player_pause_main_thread_callback(void *user_data) {
+ VideoLogInfo("Main loop thread safe pause callback called");
+ vp_play_normal_view_pause_player(user_data);
+}
+
+static void vp_player_play_main_thread_callback(void *user_data) {
+ VideoLogInfo("Main loop thread safe play callback called");
+ vp_play_normal_view_play_player(user_data);
+}
+
/**
*
* @param stream_info
VideoLogDebug("Reason for change : %d and state of playback is : %d",
reason_for_change, state_for_playback);
if (state_for_playback == SOUND_STREAM_FOCUS_STATE_RELEASED) {
- vp_play_normal_view_pause_player(pPlayView);
+
+ // this callback is called from internal thread of sound manager not from main thread
+ // elementry api need to be called from main thread to work
+ // so we can't update ui in this thread.
+ // we need to add main loop callback to update ui.
+ VideoLogInfo("Added main lopp callback to pause ui");
+ ecore_main_loop_thread_safe_call_sync(vp_player_pause_main_thread_callback, user_data);
+
sound_manager_get_focus_reacquisition(pPlayView->stream_info,
&pPlayView->reacquire_state);
if (reason_for_change == SOUND_STREAM_FOCUS_CHANGED_BY_VOIP
}
}
} else {
- vp_play_normal_view_play_player(pPlayView);
+ // this callback is called from internal thread of sound manager not from main thread
+ // elementry api need to be called from main thread to work
+ // so we can't update ui in this thread.
+ // we need to add main loop callback to update ui.
+ VideoLogInfo("Added main lopp callback to play ui");
+ ecore_main_loop_thread_safe_call_sync(vp_player_play_main_thread_callback, user_data);
}
}