summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Howard2008-02-12 22:16:12 +0000
committerSimon Howard2008-02-12 22:16:12 +0000
commit52228a0b81e919879afdd23ae82794cdfe621f84 (patch)
tree06f77466121ed3b6852db57378991cea9a88d588 /src
parent7859a115019d7311436fb540ad07bcfb933a7e30 (diff)
downloadchocolate-doom-52228a0b81e919879afdd23ae82794cdfe621f84.tar.gz
chocolate-doom-52228a0b81e919879afdd23ae82794cdfe621f84.tar.bz2
chocolate-doom-52228a0b81e919879afdd23ae82794cdfe621f84.zip
Add comment.
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1084
Diffstat (limited to 'src')
-rw-r--r--src/i_sdlsound.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/i_sdlsound.c b/src/i_sdlsound.c
index 923b5df0..54799ac3 100644
--- a/src/i_sdlsound.c
+++ b/src/i_sdlsound.c
@@ -111,7 +111,9 @@ static void ExpandSoundData_SRC(byte *data,
src_data.input_frames = length;
src_data.data_in = malloc(length * sizeof(float));
src_data.src_ratio = (double)mixer_freq / samplerate;
- src_data.output_frames = src_data.src_ratio * length + 48000;
+
+ // We include some extra space here in case of rounding-up.
+ src_data.output_frames = src_data.src_ratio * length + (mixer_freq / 4);
src_data.data_out = malloc(src_data.output_frames * sizeof(float));
assert(src_data.data_in != NULL && src_data.data_out != NULL);