From 186dd294b12c5797153cd63d3e4a94cc7d1bc2bd Mon Sep 17 00:00:00 2001 From: Eunhye Choi Date: Tue, 25 Mar 2025 19:34:14 +0900 Subject: [PATCH] [0.3.160] resolve evas resource leak - evas resource can not be released while the mainloop is occupied by player api which is waiting muse return - after getting return of unprepare operation, release evas resource Change-Id: I9add3b401351bdc412513c1ee14ac6dcfd338f07 --- packaging/capi-media-player.spec | 2 +- src/player.c | 18 +++++++----------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/packaging/capi-media-player.spec b/packaging/capi-media-player.spec index 77b2756..1f09344 100644 --- a/packaging/capi-media-player.spec +++ b/packaging/capi-media-player.spec @@ -1,6 +1,6 @@ Name: capi-media-player Summary: A Media Player API -Version: 0.3.159 +Version: 0.3.160 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/player.c b/src/player.c index ed79280..46a85b2 100644 --- a/src/player.c +++ b/src/player.c @@ -1613,7 +1613,7 @@ static void _player_internal_buffer_release(player_cli_s *pc) if (!DP_INTERFACE(pc)) { LOGW("display port interface is NULL"); - goto RELEASE_INTERNAL_MOMORY; + goto RELEASE_INTERNAL_MEMORY; } if (mm_display_interface_get_type(DP_INTERFACE(pc), &display_type) != MM_ERROR_NONE) { @@ -1622,7 +1622,7 @@ static void _player_internal_buffer_release(player_cli_s *pc) } if (display_type != MM_DISPLAY_TYPE_EVAS) - goto RELEASE_INTERNAL_MOMORY; + goto RELEASE_INTERNAL_MEMORY; if (CALLBACK_INFO(pc)->dp_info.visible != PLAYER_VISIBLE_INFO_FALSE) { if (mm_display_interface_evas_set_visible(DP_INTERFACE(pc), false) != MM_ERROR_NONE) { @@ -1631,12 +1631,13 @@ static void _player_internal_buffer_release(player_cli_s *pc) } } + /* this function waits to excute on the main thread (timeout 1 sec) */ if (mm_display_interface_evas_flush(DP_INTERFACE(pc), false) != MM_ERROR_NONE) { LOGE("mm_display_interface_evas_flush failed"); return; } -RELEASE_INTERNAL_MOMORY: +RELEASE_INTERNAL_MEMORY: _player_release_internal_memory(pc, false); pc->cb_info->video_frame_pool_size = 0; __player_remove_tsurf_list(pc); @@ -1670,15 +1671,8 @@ static bool _event_callback_handler(callback_cb_info_s *cb_info, muse_player_eve return false; } - if (event == MUSE_PLAYER_EVENT_TYPE_STATE_CHANGED || - event == MUSE_PLAYER_EVENT_TYPE_INTERRUPT) { + if (event == MUSE_PLAYER_EVENT_TYPE_INTERRUPT) _player_internal_buffer_release((player_cli_s *)cb_info->pc); - if (event == MUSE_PLAYER_EVENT_TYPE_STATE_CHANGED) { - g_free(recv_data->buffer); - g_free(recv_data); - return true; - } - } return _user_callback_handler(cb_info, event, recv_data); } @@ -2309,6 +2303,8 @@ int player_unprepare(player_h player) g_free(ret_buf); EXIT: + _player_internal_buffer_release(pc); + LOGD("LEAVE 0x%X", ret); return ret; } -- 2.34.1