[v0.6.22] post resource conflict msg regardless of videobin 98/110198/1
authorEunhae Choi <eunhae1.choi@samsung.com>
Fri, 13 Jan 2017 07:41:26 +0000 (16:41 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Fri, 13 Jan 2017 07:41:26 +0000 (16:41 +0900)
Change-Id: I04abd5a1ae2f039292fa8e06356b4d21237a651b

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

index 242160d..3cd343f 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-player
 Summary:    Multimedia Framework Player Library
-Version:    0.6.21
+Version:    0.6.22
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index e3e2eaf..4472026 100644 (file)
@@ -1445,7 +1445,7 @@ __mmplayer_gst_callback(GstBus *bus, GstMessage *msg, gpointer data) // @
                                {
                                        if (MMPLAYER_IS_STREAMING(player)) {
                                                // managed prepare async case when buffering is completed
-                                               // pending state should be reset oyherwise, it's still playing even though it's resumed after bufferging.
+                                               // pending state should be reset otherwise, it's still playing even though it's resumed after bufferging.
                                                if ((MMPLAYER_CURRENT_STATE(player) != MM_PLAYER_STATE_PLAYING) ||
                                                        (MMPLAYER_PENDING_STATE(player) == MM_PLAYER_STATE_PLAYING))
                                                        MMPLAYER_SET_STATE(player, MM_PLAYER_STATE_PLAYING);
index c886b0c..ab95c86 100644 (file)
@@ -189,6 +189,7 @@ static void mrp_resource_release_cb(mrp_res_context_t *cx, const mrp_res_resourc
        int result = MM_ERROR_NONE;
        mm_player_t* player = NULL;
        mrp_res_resource_t *res;
+       gboolean resource_released = FALSE;
 
        MMPLAYER_FENTER();
 
@@ -206,10 +207,13 @@ static void mrp_resource_release_cb(mrp_res_context_t *cx, const mrp_res_resourc
        LOGD(" - resource set state of player(%p) is changed to [%s]\n", player, state_to_str(rs->state));
        for (i = 0; i < MRP_RESOURCE_MAX; i++) {
                res = mrp_res_get_resource_by_name(rs, resource_str[i]);
-               if (res == NULL)
+               if (res == NULL) {
                        LOGW(" -- %s not present in resource set\n", resource_str[i]);
-               else
+               } else {
                        LOGD(" -- resource name [%s] -> [%s]'\n", res->name, state_to_str(res->state));
+                       if (res->state == MRP_RES_RESOURCE_ABOUT_TO_LOOSE)
+                               resource_released = TRUE;
+               }
        }
 
        /* do something to release resource here.
@@ -217,7 +221,7 @@ static void mrp_resource_release_cb(mrp_res_context_t *cx, const mrp_res_resourc
        if (!__mmplayer_can_do_interrupt(player)) {
                LOGW("no need to interrupt, so leave");
        } else {
-               if (player->pipeline->videobin) {
+               if (resource_released) {
                        player->resource_manager.by_rm_cb = TRUE;
                        LOGD("video resource conflict so, resource will be freed by unrealizing");
                        result = _mmplayer_unrealize((MMHandleType)player);