Fix rarch_playlist_load_content

This commit is contained in:
twinaphex 2015-10-31 17:18:37 +01:00
parent 1ddd33336a
commit 0c691dab06
3 changed files with 11 additions and 3 deletions

View File

@ -466,6 +466,7 @@ static int action_ok_playlist_entry(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
size_t selection;
char new_core_path[PATH_MAX_LENGTH];
uint32_t core_name_hash, core_path_hash;
const char *entry_path = NULL;
const char *entry_label = NULL;
@ -525,10 +526,11 @@ static int action_ok_playlist_entry(const char *path,
(core_name_hash == MENU_VALUE_DETECT)
)
{
return action_ok_file_load_with_detect_core(entry_path, label, type, selection_ptr, entry_idx);
if (!menu_playlist_find_associated_core(menu->db_playlist_file, new_core_path, sizeof(new_core_path)))
return action_ok_file_load_with_detect_core(entry_path, label, type, selection_ptr, entry_idx);
}
rarch_playlist_load_content(playlist, NULL, selection_ptr);
rarch_playlist_load_content(playlist, new_core_path, selection_ptr);
if (is_history)
{

View File

@ -202,6 +202,8 @@ void menu_cbs_init(void *data,
const char *path, const char *label,
unsigned type, size_t idx);
bool menu_playlist_find_associated_core(const char *path, char *s, size_t len);
#ifdef __cplusplus
}
#endif

View File

@ -1494,6 +1494,7 @@ void rarch_main_deinit(void)
void rarch_playlist_load_content(void *data, const char *core_path, unsigned idx)
{
unsigned i;
char new_core_path[PATH_MAX_LENGTH];
const char *path = NULL;
char *path_check = NULL;
char *path_tolower = NULL;
@ -1507,8 +1508,11 @@ void rarch_playlist_load_content(void *data, const char *core_path, unsigned idx
if (!playlist)
return;
if (!core_path)
core_path = new_core_path;
content_playlist_get_index(playlist,
idx, &path, NULL, core_path ? NULL : &core_path, NULL, NULL, NULL);
idx, &path, NULL, &core_path, NULL, NULL, NULL);
path_tolower = strdup(path);