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 - Error in buffer size setting in Haiku/BeOS audio driver
Summary: Error in buffer size setting in Haiku/BeOS audio driver
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: audio (show other bugs)
Version: HG 1.2
Hardware: x86 Haiku
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-01 13:45 UTC by PulkoMandy
Modified: 2013-02-11 20:57 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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