Fixed bug 1679 - Error in buffer size setting in Haiku/BeOS audio driver SDL-1.2
authorSam Lantinga <slouken@libsdl.org>
Mon, 11 Feb 2013 20:55:36 -0800
branchSDL-1.2
changeset 6855dbaee3350e32
parent 6649 1aab0b09a0e3
child 6908 8b9fcdd925d8
Fixed bug 1679 - Error in buffer size setting in Haiku/BeOS audio driver

PulkoMandy

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
src/audio/baudio/SDL_beaudio.cc
     1.1 --- a/src/audio/baudio/SDL_beaudio.cc	Sun Nov 04 19:07:49 2012 +0100
     1.2 +++ b/src/audio/baudio/SDL_beaudio.cc	Mon Feb 11 20:55:36 2013 -0800
     1.3 @@ -199,11 +199,11 @@
     1.4          return (-1);
     1.5      }
     1.6  
     1.7 -    format.buffer_size = spec->samples;
     1.8 -
     1.9  	/* Calculate the final parameters for this audio specification */
    1.10  	SDL_CalculateAudioSpec(spec);
    1.11  
    1.12 +    format.buffer_size = spec->size;
    1.13 +
    1.14  	/* Subscribe to the audio stream (creates a new thread) */
    1.15  	{ sigset_t omask;
    1.16  		SDL_MaskSignals(&omask);