| Summary: | Error in buffer size setting in Haiku/BeOS audio driver | ||
|---|---|---|---|
| Product: | SDL | Reporter: | PulkoMandy <pulkomandy> |
| Component: | audio | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 1.2 | ||
| Hardware: | x86 | ||
| OS: | Haiku | ||
Fixed, thanks! http://hg.libsdl.org/SDL/rev/245a50142ffb |
Just like in SDL, audio buffer sizes for BeOS and Haiku BSoundPlayer are sized in bytes, not frames. SDL was feeding the wrong value, leading to buffers smaller than expected and weird behaviour in some unsuspecting programs (noticed it in HivelyTracker but others are likely affected as well. The fix is fortunately very simple: --- a/src/audio/baudio/SDL_beaudio.cc dim. nov. 04 19:07:49 2012 +0100 +++ b/src/audio/baudio/SDL_beaudio.cc mar. janv. 01 22:41:22 2013 +0100 @@ -199,11 +199,11 @@ return (-1); } - format.buffer_size = spec->samples; - /* Calculate the final parameters for this audio specification */ SDL_CalculateAudioSpec(spec); + format.buffer_size = spec->size; + /* Subscribe to the audio stream (creates a new thread) */ { sigset_t omask; SDL_MaskSignals(&omask);