[player_stop] Set visible to FALSE before doing seek to 0 01/141801/1
authorJaechan Lee <jaechan3.lee@samsung.com>
Wed, 26 Jul 2017 05:57:43 +0000 (14:57 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Tue, 1 Aug 2017 11:40:14 +0000 (20:40 +0900)
[Problem] Screen blinks when the Video has finished playing
[Cause & Measure] Cause : When player_stop is getting called, first screen is always showing.
Because visible value is changed after doing seek 0.
Measure : Set visible to FALSE before doing seek to 0.
[Checking Method] message / select Video message / select Video file / check the screen when the Video has finished playing
[Team] MM FRAMEWORK
[Developer] JaeChan Lee
[Solution company] Samsung
[Change Type] Specification change

Change-Id: I3aa886b863c7d3e6d81f6ce37d9f86086bc87c87

src/player.c

index dc4a851..3df0fea 100644 (file)
@@ -2295,28 +2295,44 @@ int player_stop(player_h player)
        muse_player_api_e api = MUSE_PLAYER_API_STOP;
        player_cli_s *pc = (player_cli_s *) player;
        char *ret_buf = NULL;
+       player_state_e state = PLAYER_STATE_NONE;
 
        LOGD("ENTER");
 
-       player_msg_send(api, pc, ret_buf, ret);
-       if (ret == PLAYER_ERROR_NONE)
-               set_null_user_cb_lock(pc->cb_info, MUSE_PLAYER_EVENT_TYPE_SEEK);
+       player_msg_send(MUSE_PLAYER_API_GET_STATE, pc, ret_buf, ret);
+
+       /* check player state */
+       if (ret == PLAYER_ERROR_NONE) {
+               player_msg_get(state, ret_buf);
+               g_free(ret_buf);
+               ret_buf = NULL;
+
+               if ((state != PLAYER_STATE_PLAYING) && (state != PLAYER_STATE_PAUSED)) {
+                       LOGE("Invalid state %d", state);
+                       return PLAYER_ERROR_INVALID_STATE;
+               }
+       } else {
+               g_free(ret_buf);
+               ret_buf = NULL;
+               return PLAYER_ERROR_INVALID_OPERATION;
+       }
 
 #ifdef TIZEN_FEATURE_EVAS_RENDERER
-       if (ret != PLAYER_ERROR_INVALID_STATE) {
-               if (CALLBACK_INFO(pc) && EVAS_INFO(pc)->support_video) {
-                       if (EVAS_HANDLE(pc) && (EVAS_INFO(pc)->visible == EVAS_VISIBLE_TRUE)) {
-                               ret = mm_evas_renderer_set_visible(EVAS_HANDLE(pc), false);
-                               if (ret != MM_ERROR_NONE) {
-                                       LOGE("mm_evas_renderer_set_visible err 0x%x", ret);
-                                       return PLAYER_ERROR_INVALID_OPERATION;
-                               }
-                               /* do not update EVAS_INFO(pc)->visible to set visible true if start again */
-                       }
+       if (CALLBACK_INFO(pc) && EVAS_HANDLE(pc) &&
+               EVAS_INFO(pc)->support_video && (EVAS_INFO(pc)->visible == EVAS_VISIBLE_TRUE)) {
+               ret = mm_evas_renderer_set_visible(EVAS_HANDLE(pc), false);
+               if (ret != MM_ERROR_NONE) {
+                       LOGE("mm_evas_renderer_set_visible err 0x%x", ret);
+                       return PLAYER_ERROR_INVALID_OPERATION;
                }
+               /* do not update EVAS_INFO(pc)->visible to set visible true if start again */
        }
 #endif
 
+       player_msg_send(api, pc, ret_buf, ret);
+       if (ret == PLAYER_ERROR_NONE)
+               set_null_user_cb_lock(pc->cb_info, MUSE_PLAYER_EVENT_TYPE_SEEK);
+
        g_free(ret_buf);
        return ret;
 }