Files
qemu-reims-vgpu/tests/unit
Anees Iqbal 1600825bb0 ✅ Test dsound's playback buffer arithmetic on any host
dsoundaudio.c builds only on Windows, so nothing held the arithmetic
0c0ac356 and 4d205af8 gave its playback voice: the reserve past
DirectSound's write cursor (60 ms of whole frames, as far as the play
cursor at most), the cursors rounded to whole frames, and the bytes left
to play once the play cursor has moved. A change to any of them would
bring the clicks back on a Windows host unseen.

The three move unchanged into static inline functions of
audio/dsound-ring.h, a header of their own that includes nothing of
Windows, with the reserve's comment and DSOUND_RESERVE_US; dsoundaudio.c
calls them where it computed them, with the same operands. What a Windows
host plays does not change.

tests/unit/test-dsound-ring.c holds each on any host: the reserve at 44100
and 48000 Hz and against a short buffer, the cursors' rounding and the
write cursor's wrap, and the bytes left after a move, a move past them all
and a stall of three quarters of a turn. With the reserve at half the
buffer, as before 4d205af8, or the cursors unrounded, as before 0c0ac356,
it fails.
2026-11-27 11:23:08 -08:00
..
2026-01-13 08:29:59 +01:00
2025-11-14 13:18:04 +00:00
2024-09-13 20:11:13 +02:00
2022-12-20 17:09:41 -08:00
2023-03-28 15:23:10 -07:00