From 4af16e43cb37eb4a0140f7105490e640512e7c13 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 7 Apr 2006 22:45:08 +0000 Subject: [PATCH] minor cleanups git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@659 fefdeb5f-60dc-0310-8127-8f9354f1896f --- src/modules/module-alsa-sink.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/modules/module-alsa-sink.c b/src/modules/module-alsa-sink.c index 2e9459e..f930e61 100644 --- a/src/modules/module-alsa-sink.c +++ b/src/modules/module-alsa-sink.c @@ -124,7 +124,7 @@ static void do_write(struct userdata *u) { continue; } - pa_log(__FILE__": snd_pcm_writei() failed"); + pa_log(__FILE__": snd_pcm_writei() failed: %s", snd_strerror(frames)); return; } @@ -176,17 +176,19 @@ static pa_usec_t sink_get_latency_cb(pa_sink *s) { pa_usec_t r = 0; struct userdata *u = s->userdata; snd_pcm_sframes_t frames; + int err; + assert(s && u && u->sink); - if (snd_pcm_delay(u->pcm_handle, &frames) < 0) { - pa_log(__FILE__": failed to get delay"); + if ((err = snd_pcm_delay(u->pcm_handle, &frames)) < 0) { + pa_log(__FILE__": failed to get delay: %s", snd_strerror(err)); s->get_latency = NULL; return 0; } if (frames < 0) frames = 0; - + r += pa_bytes_to_usec(frames * u->frame_size, &s->sample_spec); if (u->memchunk.memblock) -- 2.7.4