Create RARCH_DRIVER_CTL_UPDATE_SYSTEM_AV_INFO

This commit is contained in:
twinaphex 2015-12-11 11:12:20 +01:00
parent 45de6fe3b5
commit 60f606fc65
3 changed files with 16 additions and 17 deletions

View File

@ -255,9 +255,8 @@ static void driver_set_nonblock_state(void)
*
* Returns: true (1) if successful, otherwise false (0).
**/
bool driver_update_system_av_info(const void *data)
static bool driver_update_system_av_info(const struct retro_system_av_info *info)
{
const struct retro_system_av_info *info = (const struct retro_system_av_info*)data;
struct retro_system_av_info *av_info = video_viewport_get_system_av_info();
memcpy(av_info, info, sizeof(*av_info));
@ -461,6 +460,14 @@ bool driver_ctl(enum driver_ctl_state state, void *data)
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;
if (!info)
return false;
return driver_update_system_av_info(*info);
}
return true;
case RARCH_DRIVER_CTL_NONE:
default:
break;

View File

@ -190,7 +190,11 @@ enum driver_ctl_state
*
* If nonblock state is false, sets blocking state for both
* audio and video drivers instead. */
RARCH_DRIVER_CTL_SET_NONBLOCK_STATE
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. */
RARCH_DRIVER_CTL_UPDATE_SYSTEM_AV_INFO
};
@ -253,18 +257,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_update_system_av_info:
* @info : pointer to new A/V info
*
* Update the system Audio/Video information.
* Will reinitialize audio/video drivers.
* Used by RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO.
*
* Returns: true (1) if successful, otherwise false (0).
**/
bool driver_update_system_av_info(const void *data);
/**
* find_driver_index:
* @label : string of driver type to be found.

View File

@ -1096,8 +1096,8 @@ bool rarch_environment_cb(unsigned cmd, void *data)
case RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO:
{
RARCH_LOG("Environ SET_SYSTEM_AV_INFO.\n");
return driver_update_system_av_info(
(const struct retro_system_av_info*)data);
return driver_ctl(RARCH_DRIVER_CTL_UPDATE_SYSTEM_AV_INFO,
(void**)&data);
}
case RETRO_ENVIRONMENT_SET_SUBSYSTEM_INFO: