[0.6.81] set the storage state as mounted in case of internal path 09/163209/1
authorEunhae Choi <eunhae1.choi@samsung.com>
Thu, 23 Nov 2017 08:55:52 +0000 (17:55 +0900)
committereunhae choi <eunhae1.choi@samsung.com>
Fri, 8 Dec 2017 03:06:55 +0000 (03:06 +0000)
Change-Id: Id4e9ae560de67c4424b5ef5ae20e0e989923463d
(cherry picked from commit b963029d135a85ee0e90bc62eb43df75067c97c0)

packaging/libmm-player.spec
src/mm_player_common_priv.c
src/mm_player_utils.c

index 4bef71a..cd19345 100644 (file)
@@ -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
index 942ac89..34f4350 100644 (file)
@@ -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() */
index efa9a10..20bb756 100644 (file)
@@ -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);