}
g_mutex_unlock(&data->cb_info->event_queue.idle_ev_mutex);
- if (data->cb_info->user_cb[ev])
+ if ((data->cb_info->user_cb[ev] || (ev == MUSE_PLAYER_EVENT_TYPE_SERVICE_DISCONNECTED)) &&
+ (_user_callbacks[ev]))
_user_callbacks[ev](data->cb_info, data->recv_data);
else
LOGW("user callback is unset. type : %d", ev);
event_data = (_player_cb_data *)g_queue_pop_head(ev->queue);
g_mutex_unlock(&ev->qlock);
if (event_data) {
- muse_player_event_e event_type = ((_player_cb_data *)event_data)->int_data;
+ muse_player_event_e event_type = event_data->int_data;
if (event_type == MUSE_PLAYER_EVENT_TYPE_SEEK) {
g_mutex_lock(&cb_info->seek_cb_mutex);
g_mutex_unlock(&cb_info->seek_cb_mutex);
}
- if (_player_need_sync_context(event_data->int_data)) {
- if (cb_info->user_cb[event_data->int_data] &&
- _user_callbacks[event_data->int_data]) {
+ if (_player_need_sync_context(event_type)) {
+ if ((cb_info->user_cb[event_type] || (event_type == MUSE_PLAYER_EVENT_TYPE_SERVICE_DISCONNECTED)) &&
+ _user_callbacks[event_type]) {
g_mutex_lock(&ev->idle_ev_mutex);
ev->idle_ev_list = g_list_append(ev->idle_ev_list, (gpointer)event_data);
g_mutex_unlock(&ev->idle_ev_mutex);
- LOGD("add ev %d to main loop", event_data->int_data);
+ LOGD("add ev %d to main loop", event_type);
g_idle_add_full(G_PRIORITY_DEFAULT,
(GSourceFunc)_player_event_job_function,
(gpointer)event_data,
NULL);
} else {
- LOGW("there is no registered cb for ev:%d", event_data->int_data);
+ LOGW("there is no registered cb for ev:%d", event_type);
if (event_data->recv_data) {
g_free(event_data->recv_data->buffer);
g_free(event_data->recv_data);