[0.6.30] post position msg before unrealize 85/113685/1
authorEunhae Choi <eunhae1.choi@samsung.com>
Wed, 8 Feb 2017 10:11:32 +0000 (19:11 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Wed, 8 Feb 2017 10:11:34 +0000 (19:11 +0900)
make app know the last play position if resource conflict is occurred.

Change-Id: I094400c417cba4d9ef29ef17a2eb82b9728ce043

packaging/libmm-player.spec
src/mm_player_resource.c

index 8c29ee4..07c9472 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-player
 Summary:    Multimedia Framework Player Library
-Version:    0.6.29
+Version:    0.6.30
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index 5011e81..2108b0f 100644 (file)
@@ -233,7 +233,19 @@ static void mrp_resource_release_cb(mrp_res_context_t *cx, const mrp_res_resourc
                LOGW("no need to interrupt, so leave");
        } else {
                if (resource_released) {
+                       MMMessageParamType msg = {0, };
+                       unsigned long pos = 0;
+
                        player->resource_manager.by_rm_cb = TRUE; /* will be reset in state cb */
+
+                       /* get last play position */
+                       if (_mmplayer_get_position((MMHandleType)player, MM_PLAYER_POS_FORMAT_TIME, &pos) != MM_ERROR_NONE) {
+                               LOGW("failed to get play position.");
+                       } else {
+                               msg.union_type = MM_MSG_UNION_TIME;
+                               msg.time.elapsed = (unsigned int)pos;
+                               MMPLAYER_POST_MSG(player, MM_MESSAGE_PLAY_POSITION, &msg);
+                       }
                        LOGD("video resource conflict so, resource will be freed by unrealizing");
                        result = _mmplayer_unrealize((MMHandleType)player);
                        if (result)