From 42537a67e12685b4fec909453115bf2dc4787175 Mon Sep 17 00:00:00 2001 From: jdgleaver Date: Fri, 19 Jun 2020 12:22:37 +0100 Subject: [PATCH] Fix display of core-generated messages when load content fails --- retroarch.c | 13 ++++++++++--- tasks/task_content.c | 5 ++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/retroarch.c b/retroarch.c index 842524b3c0..c8ed7369e8 100644 --- a/retroarch.c +++ b/retroarch.c @@ -14833,9 +14833,16 @@ bool command_event(enum event_command cmd, void *data) break; } case CMD_EVENT_CORE_INIT: - content_reset_savestate_backups(); { - enum rarch_core_type *type = (enum rarch_core_type*)data; + enum rarch_core_type *type = (enum rarch_core_type*)data; + rarch_system_info_t *sys_info = &p_rarch->runloop_system; + + content_reset_savestate_backups(); + + /* Ensure that disk control interface is reset */ + if (sys_info) + disk_control_set_ext_callback(&sys_info->disk_control, NULL); + if (!type || !command_event_init_core(p_rarch, *type)) return false; } @@ -17175,7 +17182,7 @@ static void runloop_core_msg_queue_push( } /* Get duration in frames */ - fps = av_info ? av_info->timing.fps : 60.0; + fps = (av_info && (av_info->timing.fps > 0)) ? av_info->timing.fps : 60.0; duration_frames = (unsigned)((fps * (float)msg->duration / 1000.0f) + 0.5f); runloop_msg_queue_push(msg->msg, diff --git a/tasks/task_content.c b/tasks/task_content.c index 0ba605d900..6e83e91ec5 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -2579,7 +2579,10 @@ bool content_init(void) { RARCH_ERR("[CONTENT LOAD]: %s\n", error_string); } - runloop_msg_queue_push(error_string, 2, ret ? 1 : 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO); + /* Do not flush the message queue here + * > This allows any core-generated error messages + * to propagate through to the frontend */ + runloop_msg_queue_push(error_string, 2, ret ? 1 : 180, false, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO); free(error_string); }