[v0.3.29] apply storage api to covert subtitle path 58/93058/2 accepted/tizen/common/20161020.173424 accepted/tizen/ivi/20161020.125918 accepted/tizen/mobile/20161020.125807 accepted/tizen/tv/20161020.125827 accepted/tizen/wearable/20161020.125847 submit/tizen/20161020.073422
authorEunhae Choi <eunhae1.choi@samsung.com>
Thu, 20 Oct 2016 07:28:57 +0000 (16:28 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Thu, 20 Oct 2016 08:06:08 +0000 (17:06 +0900)
Change-Id: If0e925a539136f40c76365d8fe23e66e7e5fed62

packaging/capi-media-player.spec
src/player.c

index 7dfe308..8095b24 100644 (file)
@@ -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
index 37377f3..b6baba6 100644 (file)
@@ -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;
 }