From: Andre Noll Date: Thu, 5 Mar 2009 21:05:22 +0000 (+0100) Subject: alsa_write: Handle EPIPE errors properly. X-Git-Tag: v0.3.4~51 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=596d1d97f90854bd941db02f1353df8e1196ccc0;p=paraslash.git alsa_write: Handle EPIPE errors properly. There's no need to throw away the data if a buffer underrun occurs. Just try to write the same data again after the snd_pcm_prepare(). --- diff --git a/alsa_write.c b/alsa_write.c index b10d5c62..f016e6ff 100644 --- a/alsa_write.c +++ b/alsa_write.c @@ -181,6 +181,8 @@ static int alsa_write_post_select(__a_unused struct sched *s, if (ret == -EPIPE) { PARA_WARNING_LOG("EPIPE\n"); snd_pcm_prepare(pad->handle); + /* try to write the same data again */ + ret = snd_pcm_writei(pad->handle, data, frames); return 1; } if (ret < 0 && ret != -EAGAIN) {