Pass the correct structure to the callback

This commit is contained in:
Andre Leiradella 2017-05-14 22:29:52 +01:00
parent 4a611b5096
commit eb08a3dbef
2 changed files with 6 additions and 6 deletions

View File

@ -449,7 +449,7 @@ audio_mixer_voice_t* audio_mixer_play(audio_mixer_sound_t* sound, bool repeat,
void audio_mixer_stop(audio_mixer_voice_t* voice)
{
if (voice && voice->stop_cb)
voice->stop_cb(voice, AUDIO_MIXER_SOUND_STOPPED);
voice->stop_cb(voice->sound, AUDIO_MIXER_SOUND_STOPPED);
}
static void audio_mixer_mix_wav(float* buffer, size_t num_frames,
@ -473,7 +473,7 @@ again:
if (voice->repeat)
{
if (voice->stop_cb)
voice->stop_cb(voice, AUDIO_MIXER_SOUND_REPEATED);
voice->stop_cb(voice->sound, AUDIO_MIXER_SOUND_REPEATED);
buf_free -= pcm_available;
pcm_available = sound->types.wav.frames * 2;
@ -483,7 +483,7 @@ again:
}
if (voice->stop_cb)
voice->stop_cb(voice, AUDIO_MIXER_SOUND_FINISHED);
voice->stop_cb(voice->sound, AUDIO_MIXER_SOUND_FINISHED);
voice->type = AUDIO_MIXER_TYPE_NONE;
}
@ -520,7 +520,7 @@ again:
if (voice->repeat)
{
if (voice->stop_cb)
voice->stop_cb(voice, AUDIO_MIXER_SOUND_REPEATED);
voice->stop_cb(voice->sound, AUDIO_MIXER_SOUND_REPEATED);
stb_vorbis_seek_start(voice->types.ogg.stream);
goto again;
@ -528,7 +528,7 @@ again:
else
{
if (voice->stop_cb)
voice->stop_cb(voice, AUDIO_MIXER_SOUND_FINISHED);
voice->stop_cb(voice->sound, AUDIO_MIXER_SOUND_FINISHED);
voice->type = AUDIO_MIXER_TYPE_NONE;
return;

View File

@ -35,7 +35,7 @@ RETRO_BEGIN_DECLS
typedef struct audio_mixer_sound audio_mixer_sound_t;
typedef struct audio_mixer_voice audio_mixer_voice_t;
typedef void (*audio_mixer_stop_cb_t)(audio_mixer_voice_t* voice, unsigned reason);
typedef void (*audio_mixer_stop_cb_t)(audio_mixer_sound_t* voice, unsigned reason);
/* Reasons passed to the stop callback. */
#define AUDIO_MIXER_SOUND_FINISHED 0