mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-05 04:06:34 -05:00
seq: fix snd_seq_drain_output return value for partial drain
The processed value was not properly updated thus the partial flush was not notified properly. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
3ce629a4c2
commit
b97a11ecf0
1 changed files with 2 additions and 1 deletions
|
|
@ -4449,13 +4449,14 @@ int snd_seq_drain_output(snd_seq_t *seq)
|
|||
while (seq->obufused > 0) {
|
||||
result = seq->ops->write(seq, seq->obuf, seq->obufused);
|
||||
if (result < 0) {
|
||||
if (result == -EAGAIN && processed)
|
||||
if (result == -EAGAIN && processed > 0)
|
||||
return seq->obufused;
|
||||
return result;
|
||||
}
|
||||
if ((size_t)result < seq->obufused)
|
||||
memmove(seq->obuf, seq->obuf + result, seq->obufused - result);
|
||||
seq->obufused -= result;
|
||||
processed += result;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue