mirror of
https://github.com/linux-speakup/espeakup.git
synced 2026-08-09 09:19:09 +02:00
fixed error condition check in alsa.c
The check was looking for a specific error when it should have been just checking for failure.
This commit is contained in:
parent
a69342fcad
commit
94e23a3a02
1 changed files with 2 additions and 3 deletions
5
alsa.c
5
alsa.c
|
|
@ -86,14 +86,13 @@ static int alsa_play_callback(short *audio, int numsamples,
|
|||
avail = minimum(avail, 32 * 2);
|
||||
to_write = minimum(avail, numsamples);
|
||||
samples_written = snd_pcm_writei(handle, audio, to_write);
|
||||
if (samples_written == -EPIPE)
|
||||
if (samples_written < 0) {
|
||||
snd_pcm_prepare(handle);
|
||||
else {
|
||||
} else {
|
||||
numsamples -= samples_written;
|
||||
audio += samples_written;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue