From b963029d135a85ee0e90bc62eb43df75067c97c0 Mon Sep 17 00:00:00 2001 From: Eunhae Choi Date: Thu, 23 Nov 2017 17:55:52 +0900 Subject: [PATCH] [0.6.81] set the storage state as mounted in case of internal path Change-Id: Id4e9ae560de67c4424b5ef5ae20e0e989923463d --- packaging/libmm-player.spec | 2 +- src/mm_player_common_priv.c | 6 ++++-- src/mm_player_utils.c | 29 +++++++++++++++-------------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/packaging/libmm-player.spec b/packaging/libmm-player.spec index 5653dda..0d8cc64 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.80 +Version: 0.6.81 Release: 0 Group: Multimedia/Libraries License: Apache-2.0 diff --git a/src/mm_player_common_priv.c b/src/mm_player_common_priv.c index 942ac89..34f4350 100644 --- a/src/mm_player_common_priv.c +++ b/src/mm_player_common_priv.c @@ -605,8 +605,10 @@ __mmplayer_handle_gst_error(mm_player_t* player, GstMessage * message, GError* e return TRUE; /* skip error to avoid duplicated posting */ - if ((player->storage_info[MMPLAYER_PATH_VOD].state <= STORAGE_STATE_REMOVED) || - (player->storage_info[MMPLAYER_PATH_TEXT].state <= STORAGE_STATE_REMOVED)) { + if (((player->storage_info[MMPLAYER_PATH_VOD].type == STORAGE_TYPE_EXTERNAL) && + (player->storage_info[MMPLAYER_PATH_VOD].state <= STORAGE_STATE_REMOVED)) || + ((player->storage_info[MMPLAYER_PATH_TEXT].type == STORAGE_TYPE_EXTERNAL) && + (player->storage_info[MMPLAYER_PATH_TEXT].state <= STORAGE_STATE_REMOVED))) { /* The error will be handled by mused. * @ref _mmplayer_manage_external_storage_state() */ diff --git a/src/mm_player_utils.c b/src/mm_player_utils.c index efa9a10..20bb756 100644 --- a/src/mm_player_utils.c +++ b/src/mm_player_utils.c @@ -336,24 +336,25 @@ bool util_get_storage_info(const char *path, MMPlayerStorageInfo *storage_info) if (strncmp(file_path, "file://", strlen("file://")) == 0) file_path = path+7; /* remove file prefix */ - if (strncmp(file_path, MEDIA_PATH_EXTERNAL, strlen(MEDIA_PATH_EXTERNAL)) == 0) + if (strncmp(file_path, MEDIA_PATH_EXTERNAL, strlen(MEDIA_PATH_EXTERNAL)) == 0) { storage_info->type = STORAGE_TYPE_EXTERNAL; - else - storage_info->type = STORAGE_TYPE_INTERNAL; - memset(storage_info->path, 0x00, MM_MAX_URL_LEN); - g_snprintf(storage_info->path, MM_MAX_URL_LEN, "%s", file_path); + memset(storage_info->path, 0x00, MM_MAX_URL_LEN); + g_snprintf(storage_info->path, MM_MAX_URL_LEN, "%s", file_path); - ret = storage_foreach_device_supported((storage_device_supported_cb)_util_storage_supported_cb, storage_info); - if (ret != STORAGE_ERROR_NONE) { - LOGE("failed to check supported storage 0x%x", ret); - return false; - } + ret = storage_foreach_device_supported((storage_device_supported_cb)_util_storage_supported_cb, storage_info); + if (ret != STORAGE_ERROR_NONE) { + LOGE("failed to check supported storage 0x%x", ret); + return false; + } - if ((storage_info->type == STORAGE_TYPE_EXTERNAL) && - (storage_info->state <= STORAGE_STATE_REMOVED)) { - LOGE("need to check the external storage state %d:%d", storage_info->id, storage_info->state); - return false; + if (storage_info->state <= STORAGE_STATE_REMOVED) { + LOGE("need to check the external storage state %d:%d", storage_info->id, storage_info->state); + return false; + } + } else { + storage_info->type = STORAGE_TYPE_INTERNAL; + storage_info->state = STORAGE_STATE_MOUNTED; } LOGD("storage info %d:%d:%d", storage_info->type, storage_info->id, storage_info->state); -- 2.7.4