From: Eunhae Choi Date: Thu, 20 Oct 2016 07:28:57 +0000 (+0900) Subject: [v0.3.29] apply storage api to covert subtitle path X-Git-Tag: accepted/tizen/common/20161020.173424^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=51194dc64ea6850be9f58837a3b583f172c5c481;p=platform%2Fcore%2Fapi%2Fplayer.git [v0.3.29] apply storage api to covert subtitle path Change-Id: If0e925a539136f40c76365d8fe23e66e7e5fed62 --- diff --git a/packaging/capi-media-player.spec b/packaging/capi-media-player.spec index 7dfe308..8095b24 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.28 +Version: 0.3.29 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/player.c b/src/player.c index 37377f3..b6baba6 100644 --- a/src/player.c +++ b/src/player.c @@ -3081,14 +3081,24 @@ int player_audio_effect_equalizer_is_available(player_h player, bool * pavailabl int player_set_subtitle_path(player_h player, const char *path) { PLAYER_INSTANCE_CHECK(player); + PLAYER_NULL_ARG_CHECK(path); int ret = PLAYER_ERROR_NONE; muse_player_api_e api = MUSE_PLAYER_API_SET_SUBTITLE_PATH; player_cli_s *pc = (player_cli_s *) player; char *ret_buf = NULL; + char subtitle_path[MAX_URL_LEN] = {0, }; LOGD("ENTER"); - player_msg_send1(api, pc, ret_buf, ret, STRING, path); + if (storage_get_origin_internal_path(path, MAX_URL_LEN, subtitle_path) < 0) { + /* cannot convert path. use the original one. */ + strncpy(subtitle_path, path, MAX_URL_LEN-1); + } else { + /* need to use converted path. */ + LOGD("Converted path : %s -> %s", path, subtitle_path); + } + + player_msg_send1(api, pc, ret_buf, ret, STRING, subtitle_path); g_free(ret_buf); return ret; } @@ -3117,10 +3127,19 @@ int player_set_progressive_download_path(player_h player, const char *path) muse_player_api_e api = MUSE_PLAYER_API_SET_PROGRESSIVE_DOWNLOAD_PATH; player_cli_s *pc = (player_cli_s *) player; char *ret_buf = NULL; + char dw_path[MAX_URL_LEN] = {0, }; LOGD("ENTER"); - player_msg_send1(api, pc, ret_buf, ret, STRING, path); + if (storage_get_origin_internal_path(path, MAX_URL_LEN, dw_path) < 0) { + /* cannot convert path. use the original one. */ + strncpy(dw_path, path, MAX_URL_LEN-1); + } else { + /* need to use converted path. */ + LOGD("Converted path : %s -> %s", path, dw_path); + } + + player_msg_send1(api, pc, ret_buf, ret, STRING, dw_path); g_free(ret_buf); return ret; }