From bf849144a5c36f4561c3f18a4c9bd99e10e29312 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 8 Feb 2010 14:46:48 +0100 Subject: [PATCH] alsa: Remove xrun(). This function tried to compute the duration of the underun but never really worked. The values were more or less random (up to hundreds of seconds) and thus of little value. --- alsa_write.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/alsa_write.c b/alsa_write.c index 3c8d063f..760b8169 100644 --- a/alsa_write.c +++ b/alsa_write.c @@ -175,23 +175,6 @@ static void alsa_write_pre_select(struct sched *s, struct task *t) s->timeout = tv; } -static void xrun(snd_pcm_t *handle) -{ - snd_pcm_status_t *status; - int ret; - struct timeval tv, diff; - - snd_pcm_status_alloca(&status); - ret = snd_pcm_status(handle, status); - if (ret < 0) - return; - if (snd_pcm_status_get_state(status) != SND_PCM_STATE_XRUN) - return; - snd_pcm_status_get_trigger_tstamp(status, &tv); - tv_diff(now, &tv, &diff); - PARA_WARNING_LOG("underrun: %lums\n", tv2ms(&diff)); -} - static void alsa_close(struct writer_node *wn) { struct private_alsa_write_data *pad = wn->private_data; @@ -274,7 +257,7 @@ again: goto again; } if (frames == -EPIPE) { - xrun(pad->handle); + PARA_WARNING_LOG("underrun (tried to write %zu bytes)\n", bytes); snd_pcm_prepare(pad->handle); return; } -- 2.39.5