X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=snd_mem.c;h=f6f9c145d85c073cf9aa2421f5cdab6d3dc17068;hb=98a14be269dba68ac9a23c23d094687e83dbdb40;hp=75f9e829560df539cc84e5a1a543d092da4a410e;hpb=8e22875426474df76c29d8ee7eb6078c7c8453f3;p=xonotic%2Fdarkplaces.git diff --git a/snd_mem.c b/snd_mem.c index 75f9e829..f6f9c145 100644 --- a/snd_mem.c +++ b/snd_mem.c @@ -24,9 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "snd_main.h" #include "snd_ogg.h" #include "snd_wav.h" -#include "snd_modplug.h" - -unsigned char resampling_buffer [48000 * 2 * 2]; /* @@ -84,7 +81,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); @@ -93,7 +90,7 @@ snd_buffer_t *Snd_CreateSndBuffer (const unsigned char *samples, unsigned int sa sb->format.channels = in_format->channels; sb->format.width = in_format->width; sb->format.speed = sb_speed; - sb->maxframes = newsampleframes; + sb->maxframes = (unsigned int)newsampleframes; sb->nbframes = 0; if (!Snd_AppendToSndBuffer (sb, samples, sampleframes, in_format)) @@ -292,7 +289,7 @@ qboolean Snd_AppendToSndBuffer (snd_buffer_t* sb, const unsigned char *samples, } } - sb->nbframes += outcount; + sb->nbframes += (unsigned int)outcount; return true; } @@ -346,11 +343,6 @@ qboolean S_LoadSound (sfx_t *sfx, qboolean complain) if (OGG_LoadVorbisFile (namebuffer, sfx)) goto loaded; } - else - { - if (ModPlug_LoadModPlugFile (namebuffer, sfx)) - goto loaded; - } } // LordHavoc: then try without the added sound/ as wav and ogg @@ -370,11 +362,6 @@ qboolean S_LoadSound (sfx_t *sfx, qboolean complain) if (OGG_LoadVorbisFile (namebuffer, sfx)) goto loaded; } - else - { - if (ModPlug_LoadModPlugFile (namebuffer, sfx)) - goto loaded; - } // Can't load the sound! sfx->flags |= SFXFLAG_FILEMISSING;