((player_error_cb) cb_info->user_cb[ev]) (code, cb_info->user_data[ev]);
}
+static void __disconnected_error_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data)
+{
+ muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_ERROR;
+
+ ((player_error_cb) cb_info->user_cb[ev]) (PLAYER_ERROR_SERVICE_DISCONNECTED, cb_info->user_data[ev]);
+}
+
static void __buffering_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data)
{
int percent;
#ifdef TIZEN_FEATURE_EVAS_RENDERER
__retrieve_buffer_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_RETURN_BUFFER */
#endif
+ __disconnected_error_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_SERVICE_DISCONNECTED */
};
gboolean _player_event_job_function(void *user_data)
g_mutex_unlock(&data->event_mutex);
g_mutex_clear(&data->event_mutex);
- g_free(data->recv_data->buffer);
- g_free(data->recv_data);
+ if (data->recv_data) {
+ g_free(data->recv_data->buffer);
+ g_free(data->recv_data);
+ }
g_free(data);
return FALSE; /* remove from the event list */
(event_id == MUSE_PLAYER_EVENT_TYPE_PD) ||
(event_id == MUSE_PLAYER_EVENT_TYPE_COMPLETE) ||
(event_id == MUSE_PLAYER_EVENT_TYPE_ERROR) ||
+ (event_id == MUSE_PLAYER_EVENT_TYPE_SERVICE_DISCONNECTED) ||
(event_id == MUSE_PLAYER_EVENT_TYPE_PREPARE)) {
LOGD("%d callback will be issued in the mainloop.", event_id);
return TRUE;
static void _notify_disconnected(callback_cb_info_s * cb_info)
{
- int code = PLAYER_ERROR_SERVICE_DISCONNECTED;
- muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_ERROR;
- if (!cb_info || !cb_info->user_cb[ev])
+ muse_player_event_e event = MUSE_PLAYER_EVENT_TYPE_SERVICE_DISCONNECTED;
+ if (!cb_info || !cb_info->user_cb[MUSE_PLAYER_EVENT_TYPE_ERROR])
return;
- ((player_error_cb) cb_info->user_cb[ev]) (code, cb_info->user_data[ev]);
+
+ if (_user_callbacks[event]) {
+ _player_cb_data *data = NULL;
+ data = g_new(_player_cb_data, 1);
+ if (!data) {
+ LOGE("fail to alloc mem");
+ return;
+ }
+ data->int_data = (int)event;
+ data->cb_info = cb_info;
+ data->recv_data = NULL;
+ g_mutex_init(&data->event_mutex);
+ _player_event_queue_add(&cb_info->event_queue, data);
+ }
}
static void *client_cb_handler(gpointer data)