From fd5e7f1466267a66ef17a03698d1e3b1323cb73d Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 26 May 2014 03:41:33 -0700 Subject: Don't print an ERR if pulse fails to get latency info due to no data It just means it was called too quickly after starting. --- Alc/backends/pulseaudio.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'Alc/backends') diff --git a/Alc/backends/pulseaudio.c b/Alc/backends/pulseaudio.c index 6ea29495..58252240 100644 --- a/Alc/backends/pulseaudio.c +++ b/Alc/backends/pulseaudio.c @@ -1107,11 +1107,16 @@ static void ALCpulsePlayback_stop(ALCpulsePlayback *self) static ALint64 ALCpulsePlayback_getLatency(ALCpulsePlayback *self) { pa_usec_t latency = 0; - int neg; + int neg, err; - if(pa_stream_get_latency(self->stream, &latency, &neg) != 0) + if((err=pa_stream_get_latency(self->stream, &latency, &neg)) != 0) { - ERR("Failed to get stream latency!\n"); + /* FIXME: if err = -PA_ERR_NODATA, it means we were called too soon + * after starting the stream and no timing info has been received from + * the server yet. Should we wait, possibly stalling the app, or give a + * dummy value? Either way, it shouldn't be 0. */ + if(err != -PA_ERR_NODATA) + ERR("Failed to get stream latency: 0x%x\n", err); return 0; } -- cgit v1.2.3