modify callback wait time step to millisecond 81/67081/1
authorHyongtaek Lim <hyongtaek.lim@samsung.com>
Mon, 25 Apr 2016 06:20:10 +0000 (15:20 +0900)
committerHyongtaek Lim <hyongtaek.lim@samsung.com>
Mon, 25 Apr 2016 06:21:05 +0000 (15:21 +0900)
Signed-off-by: Hyongtaek Lim <hyongtaek.lim@samsung.com>
Change-Id: I390ba60a6032251f341fe86915ba8ee9f4483013

include/player_private.h
src/player.c

index 57f41da5304dba2de091a2b6ecf355237321431a..da5d78471a2b3667354e1c83a9244fc01dfd10e2 100644 (file)
@@ -45,8 +45,8 @@ extern "C" {
 #define PLAYER_NULL_ARG_CHECK(arg)      \
                PLAYER_CHECK_CONDITION(arg != NULL, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER")
 
-#define CALLBACK_TIME_OUT 5
-#define MAX_SERVER_TIME_OUT 35
+#define CALLBACK_TIME_OUT 5000
+#define MAX_SERVER_TIME_OUT 35000
 
 typedef struct _ret_msg_s {
        gint api;
index aba0b271f70317cc87a9d1ed4b9ba71fc2b9ab28..9fb1b19f670612216ee50032ec1b5f0d3bb96b1d 100644 (file)
@@ -1029,12 +1029,12 @@ int client_get_api_timeout(player_cli_s * pc, muse_player_api_e api)
        case MUSE_PLAYER_API_START:
        case MUSE_PLAYER_API_STOP:
        case MUSE_PLAYER_API_PAUSE:
-               timeout += SERVER_TIMEOUT(pc);
+               timeout += SERVER_TIMEOUT(pc) * G_TIME_SPAN_MILLISECOND;
                break;
        default:
                /* check prepare async is done */
                if (pc && CALLBACK_INFO(pc) && CALLBACK_INFO(pc)->user_cb[MUSE_PLAYER_EVENT_TYPE_PREPARE])
-                       timeout += SERVER_TIMEOUT(pc);
+                       timeout += SERVER_TIMEOUT(pc) * G_TIME_SPAN_MILLISECOND;
                break;
        }
        timeout += CALLBACK_TIME_OUT;
@@ -1044,7 +1044,7 @@ int client_get_api_timeout(player_cli_s * pc, muse_player_api_e api)
 int client_wait_for_cb_return(muse_player_api_e api, callback_cb_info_s * cb_info, char **ret_buf, int time_out)
 {
        int ret = PLAYER_ERROR_NONE;
-       gint64 end_time = g_get_monotonic_time() + time_out * G_TIME_SPAN_SECOND;
+       gint64 end_time = g_get_monotonic_time() + time_out * G_TIME_SPAN_MILLISECOND;
        msg_buff_s *buff = &cb_info->buff;
        ret_msg_s *msg = NULL;
 
@@ -1053,7 +1053,7 @@ int client_wait_for_cb_return(muse_player_api_e api, callback_cb_info_s * cb_inf
        msg = _get_ret_msg(api, cb_info);
        if (!buff->recved || !msg) {
                if (!g_cond_wait_until(&cb_info->player_cond[api], &cb_info->player_mutex, end_time)) {
-                       LOGW("api %d return msg does not received %ds", api, time_out);
+                       LOGW("api %d return msg does not received %dms", api, time_out);
                        g_mutex_unlock(&cb_info->player_mutex);
                        return PLAYER_ERROR_INVALID_OPERATION;
                }