mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 12:39:56 +00:00
LIBRETRO: set closest power of 2 for scummvm audio buffer size
This commit is contained in:
parent
a9026919d4
commit
cd3cc986ed
@ -610,7 +610,16 @@ uint16 retro_setting_get_sample_rate(void) {
|
||||
}
|
||||
|
||||
uint16 retro_setting_get_audio_samples_buffer_size(void) {
|
||||
return audio_samples_per_frame + 1;
|
||||
/* ScummVM a.udio buffer size is normally between 512 and 8192, but the value
|
||||
must be one of: 256, 512, 1024, 2048, 4096, 8192, 16384, or 32768. */
|
||||
uint16 v = audio_samples_per_frame--;
|
||||
v |= v >> 1;
|
||||
v |= v >> 2;
|
||||
v |= v >> 4;
|
||||
v |= v >> 8;
|
||||
v |= v >> 16;
|
||||
|
||||
return ++v;
|
||||
}
|
||||
|
||||
void init_command_params(void) {
|
||||
|
Loading…
Reference in New Issue
Block a user