The documentation for PaStreamParameters suggestedLatency does not mention negative latencies.
I have not reviewed all host APIs but at least pa_win_wmme.c and pa_win_ds.c assume that suggestedLatency is non-negative, and directly assign to an unsigned long (BAD!!), for example in pa_win_ds.c:
The documentation for
PaStreamParameters suggestedLatency
does not mention negative latencies.I have not reviewed all host APIs but at least
pa_win_wmme.c
andpa_win_ds.c
assume thatsuggestedLatency
is non-negative, and directly assign to an unsigned long (BAD!!), for example inpa_win_ds.c
:There is equivalent code in
pa_win_wmme.c
.The fix should be to clamp to 0, e.g.
TODO:
pa_win_wmme.c
(clamp to 0)pa_win_ds.c
(clamp to 0)There is already a PR which will fix this for PA/PulseAudio #849