]> 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 d294b248c7d74c128d52602c8737539dbd4a1093..635bdd3ffb63407d8a27378fb83756a6b73b8c46 100644 (file)
--- a/snd_mem.c
+++ b/snd_mem.c
@@ -82,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);