Refactor away another function

This commit is contained in:
twinaphex 2015-11-22 15:16:03 +01:00
parent 4ad4254107
commit 08c6382c51
3 changed files with 4 additions and 16 deletions

View File

@ -482,24 +482,14 @@ static void audio_driver_readjust_input_rate(void)
#endif
}
void audio_driver_set_nonblock_state(bool toggle)
{
driver_t *driver = driver_get_ptr();
const audio_driver_t *audio = audio_get_ptr(driver);
audio->set_nonblock_state(driver->audio_data, toggle);
}
void audio_driver_set_nonblocking_state(bool enable)
{
driver_t *driver = driver_get_ptr();
const audio_driver_t *audio = audio_get_ptr(driver);
settings_t *settings = config_get_ptr();
if (driver->audio_active && driver->audio_data)
audio_driver_set_nonblock_state(settings->audio.sync ? enable : true);
audio->set_nonblock_state(driver->audio_data,
settings->audio.sync ? enable : true);
audio_data.chunk_size = enable ? audio_data.nonblock_chunk_size :
audio_data.block_chunk_size;

View File

@ -106,8 +106,6 @@ const void *audio_driver_find_handle(int index);
**/
const char *audio_driver_find_ident(int index);
void audio_driver_set_nonblock_state(bool toggle);
void audio_driver_set_nonblocking_state(bool enable);
/**

View File

@ -1446,7 +1446,7 @@ bool event_command(enum event_command cmd)
case EVENT_CMD_AUDIO_SET_NONBLOCKING_STATE:
boolean = true; /* fall-through */
case EVENT_CMD_AUDIO_SET_BLOCKING_STATE:
audio_driver_set_nonblock_state(boolean);
audio_driver_set_nonblocking_state(boolean);
break;
case EVENT_CMD_OVERLAY_SET_SCALE_FACTOR:
#ifdef HAVE_OVERLAY