diff --git a/driver.c b/driver.c index b0f1aacfd5..f22b3b929f 100644 --- a/driver.c +++ b/driver.c @@ -225,7 +225,7 @@ static void driver_adjust_system_rates(void) if (runloop_ctl(RUNLOOP_CTL_IS_NONBLOCK_FORCED, NULL)) command_event(CMD_EVENT_VIDEO_SET_NONBLOCKING_STATE, NULL); else - driver_ctl(RARCH_DRIVER_CTL_SET_NONBLOCK_STATE, NULL); + driver_set_nonblock_state(); } /** @@ -236,7 +236,7 @@ static void driver_adjust_system_rates(void) * If nonblock state is false, sets * blocking state for both audio and video drivers instead. **/ -static void driver_set_nonblock_state(void) +void driver_set_nonblock_state(void) { bool enable = input_driver_is_nonblock_state(); @@ -360,7 +360,7 @@ void drivers_init(int flags) { /* Keep non-throttled state as good as possible. */ if (input_driver_is_nonblock_state()) - driver_ctl(RARCH_DRIVER_CTL_SET_NONBLOCK_STATE, NULL); + driver_set_nonblock_state(); } } @@ -472,9 +472,6 @@ bool driver_ctl(enum driver_ctl_state state, void *data) driver_adjust_system_rates(); } break; - case RARCH_DRIVER_CTL_SET_NONBLOCK_STATE: - driver_set_nonblock_state(); - break; case RARCH_DRIVER_CTL_UPDATE_SYSTEM_AV_INFO: { const struct retro_system_av_info **info = (const struct retro_system_av_info**)data; diff --git a/driver.h b/driver.h index 34633736e6..ca423969f0 100644 --- a/driver.h +++ b/driver.h @@ -84,12 +84,6 @@ enum driver_ctl_state * calls audio_monitor_set_refresh_rate(). */ RARCH_DRIVER_CTL_SET_REFRESH_RATE, - /* Sets audio and video drivers to nonblock state. - * - * If nonblock state is false, sets blocking state for both - * audio and video drivers instead. */ - RARCH_DRIVER_CTL_SET_NONBLOCK_STATE, - /* Update the system Audio/Video information. * Will reinitialize audio/video drivers. * Used by RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO. */ @@ -115,6 +109,12 @@ typedef struct driver_ctx_info bool driver_ctl(enum driver_ctl_state state, void *data); +/* Sets audio and video drivers to nonblock state. + * + * If nonblock state is false, sets blocking state for both + * audio and video drivers instead. */ +void driver_set_nonblock_state(void); + void drivers_init(int flags); RETRO_END_DECLS diff --git a/menu/menu_driver.c b/menu/menu_driver.c index e0e787a697..5ad3570aee 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -279,7 +279,7 @@ static void menu_driver_toggle(bool on) else { if (!runloop_ctl(RUNLOOP_CTL_IS_SHUTDOWN, NULL)) - driver_ctl(RARCH_DRIVER_CTL_SET_NONBLOCK_STATE, NULL); + driver_set_nonblock_state(); if (settings && settings->menu.pause_libretro) command_event(CMD_EVENT_AUDIO_START, NULL); diff --git a/network/netplay/netplay_sync.c b/network/netplay/netplay_sync.c index ac98b9c491..68421caf6a 100644 --- a/network/netplay/netplay_sync.c +++ b/network/netplay/netplay_sync.c @@ -372,7 +372,7 @@ void netplay_sync_post_frame(netplay_t *netplay, bool stalled) { netplay->catch_up = false; input_driver_unset_nonblock_state(); - driver_ctl(RARCH_DRIVER_CTL_SET_NONBLOCK_STATE, NULL); + driver_set_nonblock_state(); } return; } @@ -524,7 +524,7 @@ void netplay_sync_post_frame(netplay_t *netplay, bool stalled) { netplay->catch_up = false; input_driver_unset_nonblock_state(); - driver_ctl(RARCH_DRIVER_CTL_SET_NONBLOCK_STATE, NULL); + driver_set_nonblock_state(); } } @@ -535,7 +535,7 @@ void netplay_sync_post_frame(netplay_t *netplay, bool stalled) /* Are we falling behind? */ netplay->catch_up = true; input_driver_set_nonblock_state(); - driver_ctl(RARCH_DRIVER_CTL_SET_NONBLOCK_STATE, NULL); + driver_set_nonblock_state(); } else if (netplay->self_frame_count + 2 < hi_frame_count) diff --git a/runloop.c b/runloop.c index fe8220fcb8..0ea85b80b0 100644 --- a/runloop.c +++ b/runloop.c @@ -910,7 +910,7 @@ static enum runloop_state runloop_check_state( input_driver_unset_nonblock_state(); else input_driver_set_nonblock_state(); - driver_ctl(RARCH_DRIVER_CTL_SET_NONBLOCK_STATE, NULL); + driver_set_nonblock_state(); } else if ((runloop_cmd_pressed(old_input, RARCH_FAST_FORWARD_HOLD_KEY) != runloop_cmd_press(current_input, RARCH_FAST_FORWARD_HOLD_KEY))) @@ -919,7 +919,7 @@ static enum runloop_state runloop_check_state( input_driver_set_nonblock_state(); else input_driver_unset_nonblock_state(); - driver_ctl(RARCH_DRIVER_CTL_SET_NONBLOCK_STATE, NULL); + driver_set_nonblock_state(); } /* Checks if the state increase/decrease keys have been pressed