aboutsummaryrefslogtreecommitdiffstats
path: root/src/audio.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/audio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/audio.c b/src/audio.c
index 47c1880cc..41489742a 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -261,7 +261,8 @@ int openAudioDevice(AudioFormat * audioFormat) {
if(!audioOpened || !isCurrentFormat) {
flushAudioBuffer();
copyAudioFormat(&audio_format, audioFormat);
- audioBufferSize = (audio_format.bits/8)*audio_format.channels;
+ audioBufferSize = (audio_format.bits >> 3)*
+ audio_format.channels;
audioBufferSize*= audio_format.sampleRate >> 5;
audioBuffer = realloc(audioBuffer, audioBufferSize);
}