X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=snd_mem.c;h=11b0a9d9a9a22a394497c627ff8293a9cb8e2824;hb=04cb3d278b366b71d8a088acd2f5ffeb5ac4f448;hp=d294b248c7d74c128d52602c8737539dbd4a1093;hpb=10e1054afd86d2b6994acffd2fa5ec4b4495a216;p=xonotic%2Fdarkplaces.git diff --git a/snd_mem.c b/snd_mem.c index d294b248..11b0a9d9 100644 --- a/snd_mem.c +++ b/snd_mem.c @@ -26,6 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "snd_wav.h" #include "snd_modplug.h" +unsigned char resampling_buffer [48000 * 2 * 2]; + /* ==================== @@ -82,7 +84,7 @@ snd_buffer_t *Snd_CreateSndBuffer (const unsigned char *samples, unsigned int sa size_t newsampleframes, memsize; snd_buffer_t* sb; - newsampleframes = (size_t) ((double)sampleframes * (double)sb_speed / (double)in_format->speed); + newsampleframes = (size_t) ceil((double)sampleframes * (double)sb_speed / (double)in_format->speed); memsize = newsampleframes * in_format->channels * in_format->width; memsize += sizeof (*sb) - sizeof (sb->samples);