aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-05-26 03:41:33 -0700
committerChris Robinson <[email protected]>2014-05-26 03:41:33 -0700
commitfd5e7f1466267a66ef17a03698d1e3b1323cb73d (patch)
treef9ee6975caaeb0d04febf621032e3306729143eb
parent0ec0f7561c4a7b44cb765011626e240a8c3a5878 (diff)
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.
-rw-r--r--Alc/backends/pulseaudio.c11
1 files changed, 8 insertions, 3 deletions
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;
}