mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-19 07:20:50 +00:00
Fix the ghastly sound quality.
Due to quake's original sound engine using a push model, the actual place to which the sound data should be written is not necessarily where the "hardware" dma cursor is, but rather where the last write finished off. Thus, the correct output location is indicated by snd_paintedtime rather than snd_shm->framepos.
This commit is contained in:
parent
fceed07d0b
commit
45288a1a7f
2 changed files with 2 additions and 2 deletions
|
@ -82,7 +82,7 @@ s_xfer_paint_buffer (portable_samplepair_t *paintbuffer, int count,
|
|||
p = (float *) paintbuffer;
|
||||
count *= snd_shm->channels;
|
||||
out_max = (snd_shm->frames * snd_shm->channels) - 1;
|
||||
out_idx = snd_shm->framepos * snd_shm->channels;
|
||||
out_idx = snd_paintedtime * snd_shm->channels;
|
||||
while (out_idx > out_max)
|
||||
out_idx -= out_max + 1;
|
||||
step = 3 - snd_shm->channels;
|
||||
|
|
|
@ -150,7 +150,7 @@ SNDDMA_ni_xfer (portable_samplepair_t *paintbuffer, int count, float volume)
|
|||
|
||||
p = (float *) paintbuffer;
|
||||
out_max = sn.frames - 1;
|
||||
out_idx = sn.framepos;
|
||||
out_idx = *plugin_info_snd_output_data.paintedtime;
|
||||
while (out_idx > out_max)
|
||||
out_idx -= out_max + 1;
|
||||
|
||||
|
|
Loading…
Reference in a new issue