diff options
author | Eunhae Choi <eunhae1.choi@samsung.com> | 2017-05-22 10:34:12 +0900 |
---|---|---|
committer | Eunhae Choi <eunhae1.choi@samsung.com> | 2017-05-22 10:46:14 +0900 |
commit | d34f62da0180313b5fc3d42a48a336dc4753d3d9 (patch) | |
tree | 7a325a8282e19e2a8a0bdac80125c804b8ee0af0 | |
parent | d95fd5e980472038c277f88bf5bf2a3d71f067d1 (diff) | |
download | libmm-player-accepted/tizen/unified/20170522.184610.tar.gz libmm-player-accepted/tizen/unified/20170522.184610.tar.bz2 libmm-player-accepted/tizen/unified/20170522.184610.zip |
[0.6.48][uri type : mem] use heap instead of tbmtizen_4.0.m1_releasesubmit/tizen/20170522.021730accepted/tizen/unified/20170522.184610
Change-Id: I0e94065ef62b4303695345c1925295e992c01a00
-rw-r--r-- | packaging/libmm-player.spec | 2 | ||||
-rw-r--r-- | src/mm_player_priv.c | 21 |
2 files changed, 19 insertions, 4 deletions
diff --git a/packaging/libmm-player.spec b/packaging/libmm-player.spec index 717f742..5e01b43 100644 --- a/packaging/libmm-player.spec +++ b/packaging/libmm-player.spec @@ -1,6 +1,6 @@ Name: libmm-player Summary: Multimedia Framework Player Library -Version: 0.6.47 +Version: 0.6.48 Release: 0 Group: Multimedia/Libraries License: Apache-2.0 diff --git a/src/mm_player_priv.c b/src/mm_player_priv.c index 39d096f..80809a7 100644 --- a/src/mm_player_priv.c +++ b/src/mm_player_priv.c @@ -7999,8 +7999,18 @@ static int __mmfplayer_parse_profile(const char *uri, void *param, MMPlayerParse LOGD("ext: %s, mem_size: %d, mmap(param): %p\n", ext, mem_size, param); if (mem_size && param) { - data->mem = param; - data->mem_size = mem_size; + if (data->mem) + free(data->mem); + + data->mem = malloc(mem_size); + + if (data->mem) { + memcpy(data->mem, param, mem_size); + data->mem_size = mem_size; + } else { + LOGE("failed to alloc mem %d", mem_size); + } + data->uri_type = MM_PLAYER_URI_TYPE_MEM; ret = MM_ERROR_NONE; } @@ -8971,7 +8981,7 @@ _mmplayer_realize(MMHandleType hplayer) // @ } } - /* FIXIT : we can use thouse in player->profile directly */ + /* profile.mem or mem_buf.buf have to be free when player is destroyed */ if (player->profile.uri_type == MM_PLAYER_URI_TYPE_MEM) { player->mem_buf.buf = (char *)player->profile.mem; player->mem_buf.len = player->profile.mem_size; @@ -12315,6 +12325,11 @@ __mmplayer_release_misc_post(mm_player_t* player) __mmplayer_video_stream_destroy_bo_list(player); __mmplayer_initialize_storage_info(player, MMPLAYER_PATH_MAX); + if (player->profile.mem) { + free(player->profile.mem); + player->profile.mem = NULL; + player->mem_buf.buf = NULL; + } player->uri_info.uri_idx = 0; MMPLAYER_FLEAVE(); } |