Merge pull request #10874 from jdgleaver/core-message-fix

Fix display of core-generated messages when load content fails
This commit is contained in:
Autechre 2020-06-19 15:49:22 +02:00 committed by GitHub
commit d762519b8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 4 deletions

View File

@ -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,

View File

@ -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);
}