mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 13:20:30 +00:00
Create RARCH_DRIVER_CTL_SET_NONBLOCK_STATE
This commit is contained in:
parent
1b768f7dcd
commit
45de6fe3b5
11
driver.c
11
driver.c
@ -211,7 +211,7 @@ static void driver_adjust_system_rates(void)
|
||||
if (system->force_nonblock)
|
||||
event_command(EVENT_CMD_VIDEO_SET_NONBLOCKING_STATE);
|
||||
else
|
||||
driver_set_nonblock_state();
|
||||
driver_ctl(RARCH_DRIVER_CTL_SET_NONBLOCK_STATE, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -222,12 +222,12 @@ static void driver_adjust_system_rates(void)
|
||||
* If nonblock state is false, sets
|
||||
* blocking state for both audio and video drivers instead.
|
||||
**/
|
||||
void driver_set_nonblock_state(void)
|
||||
static void driver_set_nonblock_state(void)
|
||||
{
|
||||
rarch_system_info_t *system = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool enable = input_driver_ctl(
|
||||
RARCH_INPUT_CTL_IS_NONBLOCK_STATE, NULL);
|
||||
rarch_system_info_t *system = NULL;
|
||||
|
||||
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system);
|
||||
|
||||
@ -370,7 +370,7 @@ void init_drivers(int flags)
|
||||
{
|
||||
/* Keep non-throttled state as good as possible. */
|
||||
if (input_driver_ctl(RARCH_INPUT_CTL_IS_NONBLOCK_STATE, NULL))
|
||||
driver_set_nonblock_state();
|
||||
driver_ctl(RARCH_DRIVER_CTL_SET_NONBLOCK_STATE, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@ -458,6 +458,9 @@ 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_NONE:
|
||||
default:
|
||||
break;
|
||||
|
17
driver.h
17
driver.h
@ -185,7 +185,12 @@ enum driver_ctl_state
|
||||
/* Sets monitor refresh rate to new value by calling
|
||||
* video_monitor_set_refresh_rate(). Subsequently
|
||||
* calls audio_monitor_set_refresh_rate(). */
|
||||
RARCH_DRIVER_CTL_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
|
||||
};
|
||||
|
||||
|
||||
@ -248,16 +253,6 @@ bool find_prev_driver(const char *label, char *s, size_t len);
|
||||
**/
|
||||
bool find_next_driver(const char *label, char *s, size_t len);
|
||||
|
||||
/**
|
||||
* driver_set_nonblock_state:
|
||||
*
|
||||
* 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);
|
||||
|
||||
/**
|
||||
* driver_update_system_av_info:
|
||||
* @info : pointer to new A/V info
|
||||
|
@ -324,7 +324,7 @@ static void menu_driver_toggle(bool latch)
|
||||
else
|
||||
{
|
||||
if (!runloop_ctl(RUNLOOP_CTL_IS_SHUTDOWN, NULL))
|
||||
driver_set_nonblock_state();
|
||||
driver_ctl(RARCH_DRIVER_CTL_SET_NONBLOCK_STATE, NULL);
|
||||
|
||||
if (settings && settings->menu.pause_libretro)
|
||||
event_command(EVENT_CMD_AUDIO_START);
|
||||
|
Loading…
x
Reference in New Issue
Block a user