]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
alsa: Remove xrun().
authorAndre Noll <maan@systemlinux.org>
Mon, 8 Feb 2010 13:46:48 +0000 (14:46 +0100)
committerAndre Noll <maan@systemlinux.org>
Mon, 8 Feb 2010 13:46:48 +0000 (14:46 +0100)
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

index 3c8d063fdd323f304db237c5ad72349f7df33c45..760b81697a61d9dd532c58613710a3164ab2d40e 100644 (file)
@@ -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;
        }