Move the is_doing_jobs flag in USE_ECORE_FUNCTIONS 20/97920/1 accepted/tizen/3.0/common/20161123.140814 accepted/tizen/3.0/ivi/20161123.083654 accepted/tizen/3.0/mobile/20161123.083416 accepted/tizen/3.0/tv/20161123.083516 accepted/tizen/3.0/wearable/20161123.083607 submit/tizen_3.0/20161122.043110
authorHyongtaek Lim <hyongtaek.lim@samsung.com>
Tue, 15 Nov 2016 06:02:02 +0000 (15:02 +0900)
committereunhae choi <eunhae1.choi@samsung.com>
Tue, 15 Nov 2016 10:09:48 +0000 (02:09 -0800)
Change-Id: I623f9644aac69d6dc0cf0931df041faba64e5ee7
Signed-off-by: Hyongtaek Lim <hyongtaek.lim@samsung.com>
(cherry picked from commit 788ccd974df36d644c05ad39998f6aa256da1678)

legacy/include/legacy_player_private.h
legacy/src/legacy_player.c

index 253f3853a25b609a516e7aee9281f0425b8afdd9..40895bca8bed93f792054d38c5d1f1c3a00e2983 100644 (file)
@@ -89,6 +89,7 @@ typedef struct _player_s{
        pthread_t prepare_async_thread;
 #ifdef USE_ECORE_FUNCTIONS
        GHashTable *ecore_jobs;
+       bool is_doing_jobs;
 #else
        pthread_t message_thread;
        GQueue *message_queue;
@@ -97,7 +98,6 @@ typedef struct _player_s{
        int current_message;
 #endif
        player_error_e error_code;
-       bool is_doing_jobs;
        media_format_h pkt_fmt;
 } player_s;
 
index 8d982b51e2da7fd26b526167d3900ff932005bf2..d916282d6ca3ef5b1f07f57a58588f97c7f55681 100644 (file)
@@ -573,12 +573,10 @@ static void __message_cb_loop(void *data)
                        {
                                LOGW("PLAYER_MESSAGE_PREPARED");
                                if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_PREPARE]) {
-                                       handle->is_doing_jobs = TRUE;
                                        handle->state = PLAYER_STATE_READY;
                                        ((player_prepared_cb)handle->user_cb[MUSE_PLAYER_EVENT_TYPE_PREPARE])(handle->user_data[MUSE_PLAYER_EVENT_TYPE_PREPARE]);
                                        handle->user_cb[MUSE_PLAYER_EVENT_TYPE_PREPARE] = NULL;
                                        handle->user_data[MUSE_PLAYER_EVENT_TYPE_PREPARE] = NULL;
-                                       handle->is_doing_jobs = FALSE;
                                } else {
                                        LOGE("null handle in PLAYER_MESSAGE_PREPARED");
                                }
@@ -588,9 +586,7 @@ static void __message_cb_loop(void *data)
                        {
                                LOGW("PLAYER_MESSAGE_ERROR");
                                if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_ERROR]) {
-                                       handle->is_doing_jobs = TRUE;
                                        ((player_error_cb)handle->user_cb[MUSE_PLAYER_EVENT_TYPE_ERROR])(handle->error_code, handle->user_data[MUSE_PLAYER_EVENT_TYPE_ERROR]);
-                                       handle->is_doing_jobs = FALSE;
                                } else {
                                        LOGE("null handle in PLAYER_MESSAGE_ERROR");
                                }
@@ -600,11 +596,9 @@ static void __message_cb_loop(void *data)
                        {
                                LOGW("PLAYER_MESSAGE_SEEK_DONE");
                                if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_SEEK]) {
-                                       handle->is_doing_jobs = TRUE;
                                        ((player_seek_completed_cb)handle->user_cb[MUSE_PLAYER_EVENT_TYPE_SEEK])(handle->user_data[MUSE_PLAYER_EVENT_TYPE_SEEK]);
                                        handle->user_cb[MUSE_PLAYER_EVENT_TYPE_SEEK] = NULL;
                                        handle->user_data[MUSE_PLAYER_EVENT_TYPE_SEEK] = NULL;
-                                       handle->is_doing_jobs = FALSE;
                                } else {
                                        LOGE("null handle in PLAYER_MESSAGE_SEEK_DONE");
                                }
@@ -614,9 +608,7 @@ static void __message_cb_loop(void *data)
                        {
                                LOGW("PLAYER_MESSAGE_EOS");
                                if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_COMPLETE]) {
-                                       handle->is_doing_jobs = TRUE;
                                        ((player_completed_cb)handle->user_cb[MUSE_PLAYER_EVENT_TYPE_COMPLETE])(handle->user_data[MUSE_PLAYER_EVENT_TYPE_COMPLETE]);
-                                       handle->is_doing_jobs = FALSE;
                                } else {
                                        LOGE("null handle in PLAYER_MESSAGE_EOS");
                                }
@@ -1147,11 +1139,11 @@ int legacy_player_destroy(player_h player)
        PLAYER_TRACE_BEGIN("MM:PLAYER:DESTROY");
        PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
+#ifdef USE_ECORE_FUNCTIONS
        if (handle->is_doing_jobs) {
                LOGE("jobs not completed. can't do destroy");
                return PLAYER_ERROR_INVALID_OPERATION;
        }
-#ifdef USE_ECORE_FUNCTIONS
        g_hash_table_remove_all(handle->ecore_jobs);
        g_hash_table_unref(handle->ecore_jobs);
        handle->ecore_jobs = NULL;