From 158e22fed53d462f8c7cb8ab527f81cc8e89a22b Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 13 Jan 2010 04:58:54 +0100 Subject: [PATCH] alsa: Always write as much as possible. No need to play games with snd_pcm_avail_update(). --- alsa_write.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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); -- 2.39.5