Merge pull request #1528 from heuripedes/master

(Menu) Fix core loading from history
This commit is contained in:
Twinaphex 2015-03-22 23:33:42 +01:00
commit 344ebe3b73
2 changed files with 16 additions and 5 deletions

View File

@ -144,9 +144,6 @@ bool menu_load_content(void)
driver_t *driver = driver_get_ptr();
global_t *global = global_get_ptr();
if (*global->fullpath || (driver->menu && driver->menu->load_no_content))
push_to_history_playlist();
/* redraw menu frame */
if (driver->menu)
driver->menu->msg_force = true;
@ -175,6 +172,10 @@ bool menu_load_content(void)
menu_shader_manager_init(driver->menu);
rarch_main_command(RARCH_CMD_HISTORY_INIT);
if (*global->fullpath || (driver->menu && driver->menu->load_no_content))
push_to_history_playlist();
rarch_main_command(RARCH_CMD_VIDEO_SET_ASPECT_RATIO);
rarch_main_command(RARCH_CMD_RESUME);

View File

@ -18,6 +18,7 @@
#include "playlist.h"
#include <compat/posix_string.h>
#include <boolean.h>
#include "retroarch_logger.h"
#include <stdio.h>
#include <stdlib.h>
@ -116,6 +117,15 @@ void content_playlist_push(content_playlist_t *playlist,
if (!playlist)
return;
if (!core_path || !*core_path || !core_name || !*core_name)
{
RARCH_ERR("cannot push NULL or empty core info into the playlist");
return;
}
if (path && !*path)
path = NULL;
for (i = 0; i < playlist->size; i++)
{
content_playlist_entry_t tmp;
@ -155,8 +165,8 @@ void content_playlist_push(content_playlist_t *playlist,
(playlist->cap - 1) * sizeof(content_playlist_entry_t));
playlist->entries[0].path = path ? strdup(path) : NULL;
playlist->entries[0].core_path = core_path ? strdup(core_path) : NULL;
playlist->entries[0].core_name = core_name ? strdup(core_name) : NULL;
playlist->entries[0].core_path = strdup(core_path);
playlist->entries[0].core_name = strdup(core_name);
playlist->size++;
}