X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=snd_mem.c;h=11b0a9d9a9a22a394497c627ff8293a9cb8e2824;hb=8ab7e82de6aed81dec7da6debee9d4e37cea9c2b;hp=75f9e829560df539cc84e5a1a543d092da4a410e;hpb=8e22875426474df76c29d8ee7eb6078c7c8453f3;p=xonotic%2Fdarkplaces.git diff --git a/snd_mem.c b/snd_mem.c index 75f9e829..11b0a9d9 100644 --- a/snd_mem.c +++ b/snd_mem.c @@ -84,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);