[0.2.57] reset cb regardless of the unprepare result 62/137262/1
authorEunhae Choi <eunhae1.choi@samsung.com>
Wed, 5 Jul 2017 06:39:09 +0000 (15:39 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Wed, 5 Jul 2017 06:39:17 +0000 (15:39 +0900)
- reset seek/prepare cb when doing unprepare
- remove deadcode

Change-Id: I6ad34ad672286f85750c16857448152b290225fb

legacy/include/legacy_player_private.h
legacy/src/legacy_player.c
packaging/mmsvc-player.spec

index ac3610966cb1afdcfb8fd1be86027840bced9137..0b9270657817ab80ad7e1e3317541a9cf2cb0b33 100644 (file)
@@ -101,7 +101,6 @@ typedef struct _player_s {
        void* display_handle;
        player_display_type_e display_type;
        int state;
-       bool is_set_pixmap_cb;
        bool is_stopped;
        bool is_display_visible;
        bool is_progressive_download;
index 03fae27a51cd14852b435056c0d04a472a0d6214..266f56efb07d083e769b477d9485bc516e8bbe34 100644 (file)
@@ -1303,6 +1303,17 @@ int legacy_player_unprepare(player_h player)
        PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
 
+       /* Initialize the setting regardless of error return */
+       if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_SEEK]) {
+               handle->user_cb[MUSE_PLAYER_EVENT_TYPE_SEEK] = NULL;
+               handle->user_data[MUSE_PLAYER_EVENT_TYPE_SEEK] = NULL;
+       }
+
+       if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_PREPARE]) {
+               handle->user_cb[MUSE_PLAYER_EVENT_TYPE_PREPARE] = NULL;
+               handle->user_data[MUSE_PLAYER_EVENT_TYPE_PREPARE] = NULL;
+       }
+
        if (!__player_state_validate(handle, PLAYER_STATE_READY)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
@@ -1315,19 +1326,8 @@ int legacy_player_unprepare(player_h player)
        if (ret != MM_ERROR_NONE) {
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
        } else {
-               if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_SEEK]) {
-                       handle->user_cb[MUSE_PLAYER_EVENT_TYPE_SEEK] = NULL;
-                       handle->user_data[MUSE_PLAYER_EVENT_TYPE_SEEK] = NULL;
-               }
-
-               if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_PREPARE]) {
-                       handle->user_cb[MUSE_PLAYER_EVENT_TYPE_PREPARE] = NULL;
-                       handle->user_data[MUSE_PLAYER_EVENT_TYPE_PREPARE] = NULL;
-               }
-
                handle->state = PLAYER_STATE_IDLE;
                handle->display_type = PLAYER_DISPLAY_TYPE_NONE;
-               handle->is_set_pixmap_cb = FALSE;
                handle->is_stopped = FALSE;
                handle->is_display_visible = TRUE;
                handle->is_progressive_download = FALSE;
@@ -2992,24 +2992,14 @@ int legacy_player_set_display(player_h player, player_display_type_e type, unsig
        player_s *handle = (player_s *)player;
        void *set_handle = NULL;
        MMDisplaySurfaceType mmType = __player_convert_display_type(type);
-
        int ret;
+       void *temp = NULL;
+
        if (!__player_state_validate(handle, PLAYER_STATE_IDLE)) {
                LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d", __FUNCTION__, PLAYER_ERROR_INVALID_STATE, handle->state);
                return PLAYER_ERROR_INVALID_STATE;
        }
-       if (handle->is_set_pixmap_cb) {
-               if (handle->state < PLAYER_STATE_READY) {
-                       /* just set below and go to "changing surface case" */
-                       handle->is_set_pixmap_cb = FALSE;
-               } else {
-                       LOGE("[%s] pixmap callback was set, try it again after calling legacy_player_unprepare()", __FUNCTION__, PLAYER_ERROR_INVALID_OPERATION);
-                       LOGE("[%s] PLAYER_ERROR_INVALID_OPERATION(0x%08x)", __FUNCTION__, PLAYER_ERROR_INVALID_OPERATION);
-                       return PLAYER_ERROR_INVALID_OPERATION;
-               }
-       }
 
-       void *temp = NULL;
        if (type == PLAYER_DISPLAY_TYPE_NONE) {
                /* NULL surface */
                handle->display_handle = 0;
index ff5957f75fddf42d7ea5bd3c441f7d3549217f15..251c143d5a5c9ec1befc693769b7b47ece346ee8 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mmsvc-player
 Summary:    A Media Player module for muse server
-Version:    0.2.56
+Version:    0.2.57
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0