Make audio_driver_callback and audio_driver_callback_set_state

more robust
This commit is contained in:
twinaphex 2015-07-08 18:57:34 +02:00
parent 4ac38a738f
commit c6992b3a6a

View File

@ -884,11 +884,17 @@ bool audio_driver_has_callback(void)
void audio_driver_callback(void)
{
if (audio_driver_has_callback())
audio_data.audio_callback.callback();
{
if (audio_data.audio_callback.callback)
audio_data.audio_callback.callback();
}
}
void audio_driver_callback_set_state(bool state)
{
if (audio_driver_has_callback())
audio_data.audio_callback.set_state(state);
{
if (audio_data.audio_callback.set_state)
audio_data.audio_callback.set_state(state);
}
}