From 5dc2f4e13f8e5cb73538aeb6ade61ceb1d902447 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 11 Feb 2013 20:55:36 -0800 Subject: [PATCH] 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/audio/baudio/SDL_beaudio.cc b/src/audio/baudio/SDL_beaudio.cc index de635f8ba..f14d0df88 100644 --- a/src/audio/baudio/SDL_beaudio.cc +++ b/src/audio/baudio/SDL_beaudio.cc @@ -199,11 +199,11 @@ int BE_OpenAudio(_THIS, SDL_AudioSpec *spec) 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);