LOGE("subtitle uri is not proper filepath.\n");
return MM_ERROR_PLAYER_INVALID_URI;
}
- LOGD("subtitle file path is [%s].\n", subtitle_uri);
+ if (!util_get_storage_info(subtitle_uri, &player->storage_info[MMPLAYER_PATH_TEXT])) {
+ LOGE("failed to get storage info of subtitle path");
+ return MM_ERROR_PLAYER_INVALID_URI;
+ }
+
+ LOGD("subtitle file path is [%s].\n", subtitle_uri);
/* create the subtitle source */
subsrc = gst_element_factory_make("filesrc", "subtitle_source");
gst_object_unref(pad);
pad = NULL;
- if (!util_get_storage_info(subtitle_uri, &player->storage_info[MMPLAYER_PATH_TEXT]))
- LOGE("failed to get storage info of subtitle path");
-
/* create dot. for debugging */
MMPLAYER_GENERATE_DOT_IF_ENABLED(player, "pipeline-with-subtitle");
MMPLAYER_FLEAVE();
LOGD("PD Location : %s\n", path);
if (path) {
+ if (!util_get_storage_info(path, &player->storage_info[MMPLAYER_PATH_VOD])) {
+ LOGE("failed to get storage info");
+ break;
+ }
player->pd_file_save_path = g_strdup(path);
} else {
LOGE("can't find pd location so, it should be set \n");
g_object_set(G_OBJECT(element), "location", player->pd_file_save_path, NULL);
else
g_object_set(G_OBJECT(element), "location", player->profile.uri, NULL);
-
g_object_get(element, "location", &location, NULL);
LOGD("PD_LOCATION [%s].\n", location);
- if (!util_get_storage_info(location, &player->storage_info[MMPLAYER_PATH_VOD]))
- LOGE("failed to get storage info");
- if (location)
+ if(location)
g_free(location);
}
}
/* file source */
case MM_PLAYER_URI_TYPE_FILE:
{
-
LOGD("using filesrc for 'file://' handler.\n");
+ if (!util_get_storage_info(player->profile.uri, &player->storage_info[MMPLAYER_PATH_VOD])) {
+ LOGE("failed to get storage info");
+ break;
+ }
element = gst_element_factory_make("filesrc", "source");
-
if (!element) {
LOGE("failed to create filesrc\n");
break;
}
g_object_set(G_OBJECT(element), "location", (player->profile.uri)+7, NULL); /* uri+7 -> remove "file:// */
- if (!util_get_storage_info(player->profile.uri, &player->storage_info[MMPLAYER_PATH_VOD]))
- LOGE("failed to get storage info");
}
break;
case MM_PLAYER_URI_TYPE_FILE:
{
LOGD("using filesrc for 'file://' handler.\n");
+ if (!util_get_storage_info(player->profile.uri, &player->storage_info[MMPLAYER_PATH_VOD])) {
+ LOGE("failed to get storage info");
+ break;
+ }
element = gst_element_factory_make("filesrc", "source");
}
g_object_set(G_OBJECT(element), "location", (player->profile.uri)+7, NULL); /* uri+7 -> remove "file:// */
- if (!util_get_storage_info(player->profile.uri, &player->storage_info[MMPLAYER_PATH_VOD]))
- LOGE("failed to get storage info");
break;
}
case MM_PLAYER_URI_TYPE_URL_HTTP:
goto EXIT;
}
+ if (!util_get_storage_info(filepath, &player->storage_info[MMPLAYER_PATH_TEXT])) {
+ LOGE("failed to get storage info of subtitle path");
+ result = MM_ERROR_PLAYER_INVALID_URI;
+ goto EXIT;
+ }
+
LOGD("old subtitle file path is [%s]\n", subtitle_uri);
LOGD("new subtitle file path is [%s]\n", filepath);
g_object_set(G_OBJECT(mainbin[MMPLAYER_M_SUBSRC].gst), "location", filepath, NULL);
- if (!util_get_storage_info(filepath, &player->storage_info[MMPLAYER_PATH_TEXT]))
- LOGE("failed to get storage info of subtitle path");
-
charset = util_get_charset(filepath);
if (charset) {
LOGD("detected charset is %s\n", charset);
MMPLAYER_RETURN_VAL_IF_FAIL(storage_info, FALSE);
- if (type == storage_info->type && state >= STORAGE_STATE_MOUNTED) {
+ if (type == storage_info->type) {
storage_info->id = storage_id;
storage_info->state = state;
return FALSE;
return false;
}
- LOGD("storage info: type %d, id %d", storage_info->type, storage_info->id);
+ if ((storage_info->type == STORAGE_TYPE_EXTERNAL) &&
+ (storage_info->state <= STORAGE_STATE_REMOVED)) {
+ LOGE("need to check the storage state : %d", storage_info->state);
+ return false;
+ }
+ LOGD("storage info: type %d, id %d", storage_info->type, storage_info->id);
return true;
}