Implement stub versions of write_avail for SDL and CTR audio drivers

This commit is contained in:
twinaphex 2015-04-11 06:56:02 +02:00
parent 9d607cbc56
commit 184fe19a79
3 changed files with 13 additions and 5 deletions

View File

@ -409,7 +409,9 @@ void init_audio(void)
if (!global->system.audio_callback.callback && driver->audio_active &&
settings->audio.rate_control)
{
if (driver->audio->buffer_size && driver->audio->write_avail)
/* Audio rate control requires write_avail
* and buffer_size to be implemented. */
if (driver->audio->buffer_size)
{
global->audio_data.driver_buffer_size =
driver->audio->buffer_size(driver->audio_data);
@ -473,9 +475,7 @@ static int audio_driver_write_avail(void)
driver_t *driver = driver_get_ptr();
const audio_driver_t *audio = audio_get_ptr(driver);
if (audio->write_avail)
return audio->write_avail(driver->audio_data);
return 0;
return audio->write_avail(driver->audio_data);
}
/*

View File

@ -204,6 +204,13 @@ static bool ctr_audio_use_float(void *data)
return false;
}
static size_t ctr_audio_write_avail(void *data)
{
/* stub */
(void)data;
return 0;
}
audio_driver_t audio_ctr = {
ctr_audio_init,
ctr_audio_write,
@ -214,6 +221,6 @@ audio_driver_t audio_ctr = {
ctr_audio_free,
ctr_audio_use_float,
"ctr",
NULL,
ctr_audio_write_avail,
NULL
};

View File

@ -233,6 +233,7 @@ static bool sdl_audio_use_float(void *data)
static size_t sdl_audio_write_avail(void *data)
{
/* stub */
(void)data;
return 0;
}