mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-17 07:58:55 +00:00
Simplify driver_set_nonblock_state
This commit is contained in:
parent
e8d6e48a74
commit
f7bb3650d9
14
driver.c
14
driver.c
@ -244,7 +244,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->nonblock_state);
|
||||
driver_set_nonblock_state();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -264,18 +264,18 @@ void driver_set_refresh_rate(float hz)
|
||||
|
||||
/**
|
||||
* driver_set_nonblock_state:
|
||||
* @enable : Enable nonblock state?
|
||||
*
|
||||
* Sets audio and video drivers to nonblock state.
|
||||
* Sets audio and video drivers to nonblock state (if enabled).
|
||||
*
|
||||
* If @enable is false, sets blocking state for both
|
||||
* audio and video drivers instead.
|
||||
* If nonblock state is false, sets
|
||||
* blocking state for both audio and video drivers instead.
|
||||
**/
|
||||
void driver_set_nonblock_state(bool enable)
|
||||
void driver_set_nonblock_state(void)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
rarch_system_info_t *system = rarch_system_info_get_ptr();
|
||||
driver_t *driver = driver_get_ptr();
|
||||
bool enable = driver->nonblock_state;
|
||||
|
||||
/* Only apply non-block-state for video if we're using vsync. */
|
||||
if (driver->video_active && video_driver_get_ptr(false))
|
||||
@ -419,7 +419,7 @@ void init_drivers(int flags)
|
||||
{
|
||||
/* Keep non-throttled state as good as possible. */
|
||||
if (driver->nonblock_state)
|
||||
driver_set_nonblock_state(driver->nonblock_state);
|
||||
driver_set_nonblock_state();
|
||||
}
|
||||
}
|
||||
|
||||
|
5
driver.h
5
driver.h
@ -328,14 +328,13 @@ bool find_next_driver(const char *label, char *s, size_t len);
|
||||
|
||||
/**
|
||||
* driver_set_nonblock_state:
|
||||
* @enable : Enable nonblock state?
|
||||
*
|
||||
* Sets audio and video drivers to nonblock state.
|
||||
*
|
||||
* If @enable is false, sets blocking state for both
|
||||
* If nonblock state is false, sets blocking state for both
|
||||
* audio and video drivers instead.
|
||||
**/
|
||||
void driver_set_nonblock_state(bool enable);
|
||||
void driver_set_nonblock_state(void);
|
||||
|
||||
/**
|
||||
* driver_set_refresh_rate:
|
||||
|
@ -287,7 +287,6 @@ int menu_driver_iterate(enum menu_action action)
|
||||
|
||||
void menu_driver_toggle(bool latch)
|
||||
{
|
||||
driver_t *driver = driver_get_ptr();
|
||||
const menu_ctx_driver_t *menu_driver = menu_ctx_driver_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
global_t *global = global_get_ptr();
|
||||
@ -323,7 +322,7 @@ void menu_driver_toggle(bool latch)
|
||||
else
|
||||
{
|
||||
if (!system->shutdown)
|
||||
driver_set_nonblock_state(driver->nonblock_state);
|
||||
driver_set_nonblock_state();
|
||||
|
||||
if (settings && settings->menu.pause_libretro)
|
||||
event_command(EVENT_CMD_AUDIO_START);
|
||||
|
Loading…
x
Reference in New Issue
Block a user