diff --git a/engine/client/m_mp3.c b/engine/client/m_mp3.c index 10d7cce56..01b0cb93a 100644 --- a/engine/client/m_mp3.c +++ b/engine/client/m_mp3.c @@ -3100,6 +3100,24 @@ sfxcache_t *S_MP3_Locate(sfx_t *sfx, sfxcache_t *buf, int start, int length) } return buf; } + +#ifndef WAVE_FORMAT_MPEGLAYER3 +#define WAVE_FORMAT_MPEGLAYER3 0x0055 +#define MPEGLAYER3_WFX_EXTRA_BYTES 12 +#define MPEGLAYER3_FLAG_PADDING_OFF 2 +#define MPEGLAYER3_ID_MPEG 1 + +typedef struct +{ + WAVEFORMATEX wfx; + WORD wID; + DWORD fdwFlags; + WORD nBlockSize; + WORD nFramesPerBlock; + WORD nCodecDelay; +} MPEGLAYER3WAVEFORMAT; +#endif + qboolean S_LoadMP3Sound (sfx_t *s, qbyte *data, int datalen, int sndspeed) { WAVEFORMATEX pcm_format; @@ -3147,9 +3165,9 @@ qboolean S_LoadMP3Sound (sfx_t *s, qbyte *data, int datalen, int sndspeed) mp3format.wfx.nBlockAlign = 1; // MUST BE ONE mp3format.wfx.nSamplesPerSec = dec->srcspeed; // 44.1kHz mp3format.fdwFlags = MPEGLAYER3_FLAG_PADDING_OFF; - mp3format.nBlockSize = 522; // voodoo value #1 + mp3format.nBlockSize = 522; // voodoo value #1 - 144 x (bitrate / sample rate) + padding mp3format.nFramesPerBlock = 1; // MUST BE ONE - mp3format.nCodecDelay = 1393; // voodoo value #2 + mp3format.nCodecDelay = 0;//1393; // voodoo value #2 mp3format.wID = MPEGLAYER3_ID_MPEG; if (!qacmStartup() || 0!=qacmStreamOpen(&dec->acm, drv, (WAVEFORMATEX*)&mp3format, &pcm_format, NULL, 0, 0, 0)) diff --git a/engine/common/q1bsp.c b/engine/common/q1bsp.c index b10fb3256..096280934 100644 --- a/engine/common/q1bsp.c +++ b/engine/common/q1bsp.c @@ -368,6 +368,7 @@ struct traceinfo_s vec3_t end; }; +#if 0 #include "shader.h" void TestDrawPlane(float *normal, float dist, float r, float g, float b) { @@ -446,6 +447,7 @@ void TestDrawPlane(float *normal, float dist, float r, float g, float b) t->numidx = cl_numstrisidx - t->firstidx; t->numvert += 4; } +#endif static void Q1BSP_ClipToBrushes(struct traceinfo_s *traceinfo, mbrush_t *brush) { diff --git a/engine/common/zone.c b/engine/common/zone.c index 6295cc0b1..26e5af1cd 100644 --- a/engine/common/zone.c +++ b/engine/common/zone.c @@ -1677,7 +1677,9 @@ void *Cache_Check(cache_user_t *c) void Cache_Flush(void) { +#ifndef SERVERONLY S_Purge(false); +#endif while(cache_head) { Cache_Free(cache_head->user);