aboutsummaryrefslogtreecommitdiffstats
path: root/alc/backends
diff options
context:
space:
mode:
Diffstat (limited to 'alc/backends')
-rw-r--r--alc/backends/opensl.cpp8
-rw-r--r--alc/backends/pipewire.cpp14
2 files changed, 11 insertions, 11 deletions
diff --git a/alc/backends/opensl.cpp b/alc/backends/opensl.cpp
index 9ecde509..48642496 100644
--- a/alc/backends/opensl.cpp
+++ b/alc/backends/opensl.cpp
@@ -916,18 +916,18 @@ void OpenSLCapture::captureSamples(al::byte *buffer, uint samples)
}
SLAndroidSimpleBufferQueueItf bufferQueue{};
- if(likely(mDevice->Connected.load(std::memory_order_acquire)))
+ if(mDevice->Connected.load(std::memory_order_acquire)) [[allikely]]
{
const SLresult result{VCALL(mRecordObj,GetInterface)(SL_IID_ANDROIDSIMPLEBUFFERQUEUE,
&bufferQueue)};
PRINTERR(result, "recordObj->GetInterface");
- if(unlikely(SL_RESULT_SUCCESS != result))
+ if(SL_RESULT_SUCCESS != result) [[alunlikely]]
{
mDevice->handleDisconnect("Failed to get capture buffer queue: 0x%08x", result);
bufferQueue = nullptr;
}
}
- if(unlikely(!bufferQueue) || adv_count == 0)
+ if(!bufferQueue || adv_count == 0)
return;
/* For each buffer chunk that was fully read, queue another writable buffer
@@ -942,7 +942,7 @@ void OpenSLCapture::captureSamples(al::byte *buffer, uint samples)
SLresult result{SL_RESULT_SUCCESS};
auto wdata = mRing->getWriteVector();
- if(likely(adv_count > wdata.second.len))
+ if(adv_count > wdata.second.len) [[allikely]]
{
auto len1 = std::min(wdata.first.len, adv_count-wdata.second.len);
auto buf1 = wdata.first.buf + chunk_size*(wdata.first.len-len1);
diff --git a/alc/backends/pipewire.cpp b/alc/backends/pipewire.cpp
index 057ab34b..48a1cb10 100644
--- a/alc/backends/pipewire.cpp
+++ b/alc/backends/pipewire.cpp
@@ -474,7 +474,7 @@ struct EventManager {
*/
void waitForInit()
{
- if(unlikely(!mInitDone.load(std::memory_order_acquire)))
+ if(!mInitDone.load(std::memory_order_acquire)) [[alunlikely]]
{
MainloopUniqueLock plock{mLoop};
plock.wait([this](){ return mInitDone.load(std::memory_order_acquire); });
@@ -857,7 +857,7 @@ void NodeProxy::infoCallback(const pw_node_info *info)
{
/* Can this actually change? */
const char *media_class{spa_dict_lookup(info->props, PW_KEY_MEDIA_CLASS)};
- if(unlikely(!media_class)) return;
+ if(!media_class) [[alunlikely]] return;
NodeType ntype{};
if(al::strcasecmp(media_class, AudioSinkClass) == 0)
@@ -901,7 +901,7 @@ void NodeProxy::paramCallback(int, uint32_t id, uint32_t, uint32_t, const spa_po
if(id == SPA_PARAM_EnumFormat)
{
DeviceNode *node{DeviceNode::Find(mId)};
- if(unlikely(!node)) return;
+ if(!node) [[alunlikely]] return;
if(const spa_pod_prop *prop{spa_pod_find_prop(param, nullptr, SPA_FORMAT_AUDIO_rate)})
node->parseSampleRate(&prop->value);
@@ -1326,7 +1326,7 @@ void PipeWirePlayback::ioChangedCallback(uint32_t id, void *area, uint32_t size)
void PipeWirePlayback::outputCallback()
{
pw_buffer *pw_buf{pw_stream_dequeue_buffer(mStream.get())};
- if(unlikely(!pw_buf)) return;
+ if(!pw_buf) [[alunlikely]] return;
const al::span<spa_data> datas{pw_buf->buffer->datas,
minu(mNumChannels, pw_buf->buffer->n_datas)};
@@ -1342,7 +1342,7 @@ void PipeWirePlayback::outputCallback()
uint length{mRateMatch ? mRateMatch->size : 0u};
#endif
/* If no length is specified, use the device's update size as a fallback. */
- if(unlikely(!length)) length = mDevice->UpdateSize;
+ if(!length) [[alunlikely]] length = mDevice->UpdateSize;
/* For planar formats, each datas[] seems to contain one channel, so store
* the pointers in an array. Limit the render length in case the available
@@ -1713,7 +1713,7 @@ ClockLatency PipeWirePlayback::getClockLatency()
*/
nanoseconds monoclock{seconds{tspec.tv_sec} + nanoseconds{tspec.tv_nsec}};
nanoseconds curtic{}, delay{};
- if(unlikely(ptime.rate.denom < 1))
+ if(ptime.rate.denom < 1) [[alunlikely]]
{
/* If there's no stream rate, the stream hasn't had a chance to get
* going and return time info yet. Just use dummy values.
@@ -1811,7 +1811,7 @@ void PipeWireCapture::stateChangedCallback(pw_stream_state, pw_stream_state, con
void PipeWireCapture::inputCallback()
{
pw_buffer *pw_buf{pw_stream_dequeue_buffer(mStream.get())};
- if(unlikely(!pw_buf)) return;
+ if(!pw_buf) [[alunlikely]] return;
spa_data *bufdata{pw_buf->buffer->datas};
const uint offset{minu(bufdata->chunk->offset, bufdata->maxsize)};