fixed building failure
[platform/core/multimedia/libmm-player.git] / src / mm_player_utils.c
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);