{
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);
int result = MM_ERROR_NONE;
mm_player_t* player = NULL;
mrp_res_resource_t *res;
+ gboolean resource_released = FALSE;
MMPLAYER_FENTER();
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.
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);