Commit 0a206817 authored by BearOso's avatar BearOso
Browse files

libretro: Send all samples at frame end.

parent 2262544c
......@@ -753,21 +753,6 @@ static void update_variables(void)
}
}
static void S9xAudioCallback(void*)
{
static std::vector<int16_t> audio_buffer;
size_t avail = S9xGetSampleCount();
if (avail > 256)
{
if (audio_buffer.size() < avail)
audio_buffer.resize(avail);
S9xMixSamples((uint8*)&audio_buffer[0], avail);
audio_batch_cb(&audio_buffer[0], avail >> 1);
}
}
void retro_get_system_info(struct retro_system_info *info)
{
memset(info,0,sizeof(retro_system_info));
......@@ -1368,7 +1353,7 @@ void retro_init(void)
S9xInitSound(32);
S9xSetSoundMute(FALSE);
S9xSetSamplesAvailableCallback(S9xAudioCallback, NULL);
S9xSetSamplesAvailableCallback(NULL, NULL);
GFX.Pitch = MAX_SNES_WIDTH_NTSC * sizeof(uint16);
screen_buffer = (uint16*) calloc(1, GFX.Pitch * (MAX_SNES_HEIGHT + 16));
......@@ -1851,7 +1836,16 @@ void retro_run()
poll_cb();
report_buttons();
S9xMainLoop();
S9xAudioCallback(NULL);
static std::vector<int16_t> audio_buffer;
size_t avail = S9xGetSampleCount();
if (audio_buffer.size() < avail)
audio_buffer.resize(avail);
S9xMixSamples((uint8*)&audio_buffer[0], avail);
audio_batch_cb(&audio_buffer[0], avail >> 1);
}
void retro_deinit()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment