X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=snd_win.c;h=06aed2bbe03dcb4f358b4aa67d50853aa6302bb1;hb=fb468107b060a8807014662ed251ab6e82ec7f7a;hp=502468a42ceb838df9aab54d2dab492105e582dc;hpb=011bda4743f481c7b085ded092f720c3765ae0a7;p=xonotic%2Fdarkplaces.git diff --git a/snd_win.c b/snd_win.c index 502468a4..06aed2bb 100644 --- a/snd_win.c +++ b/snd_win.c @@ -152,10 +152,14 @@ static qboolean SndSys_BuildWaveFormat (const snd_format_t* requested, WAVEFORMA pfmtex->nBlockAlign = pfmtex->nChannels * pfmtex->wBitsPerSample / 8; pfmtex->nAvgBytesPerSec = pfmtex->nSamplesPerSec * pfmtex->nBlockAlign; + // LordHavoc: disabled this WAVE_FORMAT_EXTENSIBLE support because it does not seem to be working +#if 0 if (requested->channels <= 2) { +#endif pfmtex->wFormatTag = WAVE_FORMAT_PCM; pfmtex->cbSize = 0; +#if 0 } else { @@ -183,6 +187,7 @@ static qboolean SndSys_BuildWaveFormat (const snd_format_t* requested, WAVEFORMA return false; } } +#endif return true; } @@ -321,7 +326,7 @@ static sndinitstat SndSys_InitDirectSound (const snd_format_t* requested) requested->speed != format.Format.nSamplesPerSec) { Con_Printf("DS:CreateSoundBuffer Failed (%d): channels=%u, width=%u, speed=%u\n", - result, format.Format.nChannels, format.Format.wBitsPerSample / 8, format.Format.nSamplesPerSec); + (int)result, (unsigned)format.Format.nChannels, (unsigned)format.Format.wBitsPerSample / 8, (unsigned)format.Format.nSamplesPerSec); SndSys_Shutdown (); return SIS_FAILURE; } @@ -703,10 +708,7 @@ unsigned int SndSys_GetSoundTime (void) unsigned int diff; IDirectSoundBuffer_GetCurrentPosition(pDSBuf, &dwTime, NULL); - if (dwTime > dwStartTime) - diff = dwTime - dwStartTime; - else - diff = gSndBufSize - dwStartTime + dwTime; + diff = (unsigned int)(dwTime - dwStartTime) % (unsigned int)gSndBufSize; dwStartTime = dwTime; dsound_time += diff / factor;