From: Andre Noll Date: Wed, 13 Jan 2010 03:58:54 +0000 (+0100) Subject: alsa: Always write as much as possible. X-Git-Tag: v0.4.2~121 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=158e22fed53d462f8c7cb8ab527f81cc8e89a22b;ds=sidebyside alsa: Always write as much as possible. No need to play games with snd_pcm_avail_update(). --- diff --git a/alsa_write.c b/alsa_write.c index 27a8db3d..658183ea 100644 --- a/alsa_write.c +++ b/alsa_write.c @@ -352,11 +352,6 @@ again: wn->min_iqs = pad->bytes_per_frame; } frames = bytes / pad->bytes_per_frame; - avail = snd_pcm_avail_update(pad->handle); - if (avail <= 0) - return; - frames = PARA_MIN(frames, avail); - //PARA_CRIT_LOG("writing %ld frames\n", frames); frames = snd_pcm_writei(pad->handle, data, frames); if (frames >= 0) { btr_consume(btrn, frames * pad->bytes_per_frame); @@ -367,9 +362,9 @@ again: snd_pcm_prepare(pad->handle); return; } - PARA_WARNING_LOG("%s\n", snd_strerror(-frames)); if (frames == -EAGAIN) return; + PARA_WARNING_LOG("%s\n", snd_strerror(-frames)); ret = -E_ALSA_WRITE; err: assert(ret < 0);