]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_mem.c
fix several issues with PRVM_64, mostly cleaning up (int) casts
[xonotic/darkplaces.git] / snd_mem.c
index 75f9e829560df539cc84e5a1a543d092da4a410e..635bdd3ffb63407d8a27378fb83756a6b73b8c46 100644 (file)
--- a/snd_mem.c
+++ b/snd_mem.c
@@ -26,8 +26,6 @@ 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];
-
 
 /*
 ====================
@@ -84,7 +82,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);