We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1679

Summary: Error in buffer size setting in Haiku/BeOS audio driver
Product: SDL Reporter: PulkoMandy <pulkomandy>
Component: audioAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 1.2   
Hardware: x86   
OS: Haiku   

Description PulkoMandy 2013-01-01 13:45:27 UTC
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);
Comment 1 Sam Lantinga 2013-02-11 20:57:20 UTC
Fixed, thanks!
http://hg.libsdl.org/SDL/rev/245a50142ffb