mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-22 02:08:46 +00:00
fix for audio buffering
This commit is contained in:
parent
b1d12a59e5
commit
26f7e3539f
1 changed files with 8 additions and 2 deletions
|
@ -93,8 +93,14 @@ s32 SDLAudio::AudioOutOutput(s32 handle, const void* ptr) {
|
|||
if (!port.isOpen || ptr == nullptr)
|
||||
return 0;
|
||||
|
||||
return SDL_PutAudioStreamData(port.stream, ptr,
|
||||
port.samples_num * port.sample_size * port.channels_num);
|
||||
int result=SDL_PutAudioStreamData(port.stream, ptr,
|
||||
port.samples_num * port.sample_size * port.channels_num);
|
||||
// TODO find a correct value 8192 is estimated
|
||||
while (SDL_GetAudioStreamAvailable(port.stream) > 8192) {
|
||||
SDL_Delay(0);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace Audio
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue