[0.6.30] post position msg before unrealize 03/114603/1 accepted/tizen/3.0/common/20170215.121310 accepted/tizen/3.0/ivi/20170215.034236 accepted/tizen/3.0/mobile/20170215.033729 accepted/tizen/3.0/tv/20170215.033950 accepted/tizen/3.0/wearable/20170215.034107 submit/tizen_3.0/20170214.112531
authorEunhae Choi <eunhae1.choi@samsung.com>
Wed, 8 Feb 2017 10:11:32 +0000 (19:11 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Tue, 14 Feb 2017 07:19:17 +0000 (16:19 +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 8e5483f5c3d8ba9d1cd768d0051f25595bc9baf8..19d6527f3c58e96fc447daab400921c441878ea8 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 5011e81a35b2191f28fdd5ac9181904ce34f228f..2108b0f0ba1e63921cc2eefab16551888c34ca5e 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)