attempt to fix waveout > 22Khz submit issues, support 8khz sound
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2262 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
d18c74e47c
commit
968ddb9759
2 changed files with 21 additions and 4 deletions
|
@ -171,6 +171,7 @@ static void WAV_Submit(soundcardinfo_t *sc)
|
|||
LPWAVEHDR h;
|
||||
int wResult;
|
||||
wavhandle_t *wh = sc->handle;
|
||||
int chunkstosubmit;
|
||||
|
||||
//
|
||||
// find which sound blocks have completed
|
||||
|
@ -194,7 +195,12 @@ static void WAV_Submit(soundcardinfo_t *sc)
|
|||
//
|
||||
// submit two new sound blocks
|
||||
//
|
||||
while (((sc->snd_sent - sc->snd_completed) >> ((sc->sn.samplebits/8) - 1)) < 4)
|
||||
if (sc->sn.speed <= 22050)
|
||||
chunkstosubmit = 4;
|
||||
else
|
||||
chunkstosubmit = 4 + (sc->sn.speed/6000);
|
||||
|
||||
while (((sc->snd_sent - sc->snd_completed) >> ((sc->sn.samplebits/8) - 1)) < chunkstosubmit)
|
||||
{
|
||||
h = wh->lpWaveHdr + ( sc->snd_sent&WAV_MASK );
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue