diff options
Diffstat (limited to 'alc/backends/pulseaudio.cpp')
-rw-r--r-- | alc/backends/pulseaudio.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/alc/backends/pulseaudio.cpp b/alc/backends/pulseaudio.cpp index 9b7e2c08..4b0e316f 100644 --- a/alc/backends/pulseaudio.cpp +++ b/alc/backends/pulseaudio.cpp @@ -667,7 +667,7 @@ void PulsePlayback::streamWriteCallback(pa_stream *stream, size_t nbytes) noexce pa_free_cb_t free_func{nullptr}; auto buflen = static_cast<size_t>(-1); void *buf{}; - if(pa_stream_begin_write(stream, &buf, &buflen) || !buf) [[unlikely]] + if(pa_stream_begin_write(stream, &buf, &buflen) || !buf) UNLIKELY { buflen = nbytes; buf = pa_xmalloc(buflen); @@ -680,7 +680,7 @@ void PulsePlayback::streamWriteCallback(pa_stream *stream, size_t nbytes) noexce mDevice->renderSamples(buf, static_cast<uint>(buflen/mFrameSize), mSpec.channels); int ret{pa_stream_write(stream, buf, buflen, free_func, 0, PA_SEEK_RELATIVE)}; - if(ret != PA_OK) [[unlikely]] + if(ret != PA_OK) UNLIKELY ERR("Failed to write to stream: %d, %s\n", ret, pa_strerror(ret)); } while(nbytes > 0); } @@ -1006,7 +1006,7 @@ ClockLatency PulsePlayback::getClockLatency() err = pa_stream_get_latency(mStream, &latency, &neg); } - if(err != 0) [[unlikely]] + if(err != 0) UNLIKELY { /* 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 @@ -1017,7 +1017,7 @@ ClockLatency PulsePlayback::getClockLatency() latency = mDevice->BufferSize - mDevice->UpdateSize; neg = 0; } - else if(neg) [[unlikely]] + else if(neg) UNLIKELY latency = 0; ret.Latency = std::chrono::microseconds{latency}; @@ -1240,7 +1240,7 @@ void PulseCapture::captureSamples(al::byte *buffer, uint samples) mLastReadable -= static_cast<uint>(dstbuf.size()); while(!dstbuf.empty()) { - if(mHoleLength > 0) [[unlikely]] + if(mHoleLength > 0) UNLIKELY { const size_t rem{minz(dstbuf.size(), mHoleLength)}; std::fill_n(dstbuf.begin(), rem, mSilentVal); @@ -1259,7 +1259,7 @@ void PulseCapture::captureSamples(al::byte *buffer, uint samples) continue; } - if(!mDevice->Connected.load(std::memory_order_acquire)) [[unlikely]] + if(!mDevice->Connected.load(std::memory_order_acquire)) UNLIKELY break; MainloopUniqueLock plock{mMainloop}; @@ -1270,7 +1270,7 @@ void PulseCapture::captureSamples(al::byte *buffer, uint samples) } const pa_stream_state_t state{pa_stream_get_state(mStream)}; - if(!PA_STREAM_IS_GOOD(state)) [[unlikely]] + if(!PA_STREAM_IS_GOOD(state)) UNLIKELY { mDevice->handleDisconnect("Bad capture state: %u", state); break; @@ -1278,7 +1278,7 @@ void PulseCapture::captureSamples(al::byte *buffer, uint samples) const void *capbuf; size_t caplen; - if(pa_stream_peek(mStream, &capbuf, &caplen) < 0) [[unlikely]] + if(pa_stream_peek(mStream, &capbuf, &caplen) < 0) UNLIKELY { mDevice->handleDisconnect("Failed retrieving capture samples: %s", pa_strerror(pa_context_errno(mContext))); @@ -1287,7 +1287,7 @@ void PulseCapture::captureSamples(al::byte *buffer, uint samples) plock.unlock(); if(caplen == 0) break; - if(!capbuf) [[unlikely]] + if(!capbuf) UNLIKELY mHoleLength = caplen; else mCapBuffer = {static_cast<const al::byte*>(capbuf), caplen}; @@ -1305,7 +1305,7 @@ uint PulseCapture::availableSamples() { MainloopUniqueLock plock{mMainloop}; size_t got{pa_stream_readable_size(mStream)}; - if(static_cast<ssize_t>(got) < 0) [[unlikely]] + if(static_cast<ssize_t>(got) < 0) UNLIKELY { const char *err{pa_strerror(static_cast<int>(got))}; ERR("pa_stream_readable_size() failed: %s\n", err); @@ -1342,13 +1342,13 @@ ClockLatency PulseCapture::getClockLatency() err = pa_stream_get_latency(mStream, &latency, &neg); } - if(err != 0) [[unlikely]] + if(err != 0) UNLIKELY { ERR("Failed to get stream latency: 0x%x\n", err); latency = 0; neg = 0; } - else if(neg) [[unlikely]] + else if(neg) UNLIKELY latency = 0; ret.Latency = std::chrono::microseconds{latency}; |