alsa-seq: fix off-by-one for event offset

The event offsets need to go from 0 to quantum-1 to be valid to the
current midi event buffer.

Fixes #1395
This commit is contained in:
Wim Taymans 2021-07-05 16:25:11 +02:00
parent 831fb9ea01
commit 0b758a2301

View file

@ -553,7 +553,7 @@ static int process_read(struct seq_state *state)
/* convert the age to samples and convert to an offset */
offset = (diff * state->rate.denom) / (state->rate.num * SPA_NSEC_PER_SEC);
if (state->duration > offset)
offset = state->duration - offset;
offset = state->duration - 1 - offset;
else
offset = 0;