fix(audio): keep 512-frame power-of-two default on SDL2 fallback #1550

Merged
suarezoscar merged 1 commit from fix/sdl2-audio-samples-power-of-two into main 2026-11-10 07:47:42 +00:00
suarezoscar commented 2026-11-10 07:36:04 +00:00 (Migrated from github.com)

What

Keeps want.samples defaulting to 512 (power of two) on the SDL2 fallback branch when SDL_AUDIO_DEVICE_SAMPLE_FRAMES is unset, while preserving 480 on SDL3 and honoring env_samples on both paths. Also tightens tests/test_sdl_audio_library.py to explicitly verify both the SDL3 hint and the SDL2 want.samples assignment.

Why

Follow-up to review feedback from @hckrman101 on #1329: SDL2's SDL_AudioSpec documentation specifies a power-of-two buffer size for samples, and checking the SDL2 assignment explicitly in the regression test ensures env_samples cannot be silently ignored in the SDL2 branch.

How it was tested

  • python3 tests/test_sdl_audio_library.py (4 passed).
## What Keeps `want.samples` defaulting to `512` (power of two) on the SDL2 fallback branch when `SDL_AUDIO_DEVICE_SAMPLE_FRAMES` is unset, while preserving `480` on SDL3 and honoring `env_samples` on both paths. Also tightens `tests/test_sdl_audio_library.py` to explicitly verify both the SDL3 hint and the SDL2 `want.samples` assignment. ## Why Follow-up to review feedback from @hckrman101 on #1329: SDL2's `SDL_AudioSpec` documentation specifies a power-of-two buffer size for `samples`, and checking the SDL2 assignment explicitly in the regression test ensures `env_samples` cannot be silently ignored in the SDL2 branch. ## How it was tested - `python3 tests/test_sdl_audio_library.py` (4 passed).
Commenting is not possible because the repository is archived.
No description provided.