diff options
author | Chris Robinson <[email protected]> | 2020-03-30 20:06:24 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-03-30 20:06:24 -0700 |
commit | bf48dcd37535ccf3146082cee421f418bb0cb66b (patch) | |
tree | 7c310dab49a55645dc4f57d7b8cecd4c631e1035 | |
parent | b9f19c6ca27c7363aa82b1cf0970d137d4e450ea (diff) |
Report better latency when PulseAudio has no timing info
-rw-r--r-- | alc/backends/pulseaudio.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/alc/backends/pulseaudio.cpp b/alc/backends/pulseaudio.cpp index 51f8cfc8..da37b9b5 100644 --- a/alc/backends/pulseaudio.cpp +++ b/alc/backends/pulseaudio.cpp @@ -1107,13 +1107,13 @@ ClockLatency PulsePlayback::getClockLatency() if UNLIKELY(err != 0) { - /* 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, it means we were called too soon after + * starting the stream and no timing info has been received from the + * server yet. Give a generic value since nothing better is available. + */ if(err != -PA_ERR_NODATA) ERR("Failed to get stream latency: 0x%x\n", err); - latency = 0; + latency = mDevice->BufferSize - mDevice->UpdateSize; neg = 0; } else if UNLIKELY(neg) |