aboutsummaryrefslogtreecommitdiffstats
path: root/alc/backends/pipewire.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-03-01 11:35:39 -0800
committerChris Robinson <[email protected]>2023-03-01 11:35:39 -0800
commitfde74453a62a1ce4b5efaac0ec1835b9f5731e25 (patch)
treeed74db646800b78ca8651bb5291453927f48cd93 /alc/backends/pipewire.cpp
parentec9c421d312d6df701631877f6ce6256355101dc (diff)
Use macros for the likely/unlikely attributes
The syntax parser for GCC 8 (and earlier?) fails when these attributes are in certain places.
Diffstat (limited to 'alc/backends/pipewire.cpp')
-rw-r--r--alc/backends/pipewire.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/alc/backends/pipewire.cpp b/alc/backends/pipewire.cpp
index 7bde4b78..c6569a74 100644
--- a/alc/backends/pipewire.cpp
+++ b/alc/backends/pipewire.cpp
@@ -477,7 +477,7 @@ struct EventManager {
*/
void waitForInit()
{
- if(!mInitDone.load(std::memory_order_acquire)) [[unlikely]]
+ if(!mInitDone.load(std::memory_order_acquire)) UNLIKELY
{
MainloopUniqueLock plock{mLoop};
plock.wait([this](){ return mInitDone.load(std::memory_order_acquire); });
@@ -862,7 +862,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(!media_class) [[unlikely]] return;
+ if(!media_class) UNLIKELY return;
NodeType ntype{};
if(al::strcasecmp(media_class, AudioSinkClass) == 0)
@@ -919,7 +919,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(!node) [[unlikely]] return;
+ if(!node) UNLIKELY return;
if(const spa_pod_prop *prop{spa_pod_find_prop(param, nullptr, SPA_FORMAT_AUDIO_rate)})
node->parseSampleRate(&prop->value);
@@ -1344,7 +1344,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(!pw_buf) [[unlikely]] return;
+ if(!pw_buf) UNLIKELY return;
const al::span<spa_data> datas{pw_buf->buffer->datas,
minu(mNumChannels, pw_buf->buffer->n_datas)};
@@ -1360,7 +1360,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(!length) [[unlikely]] length = mDevice->UpdateSize;
+ if(!length) UNLIKELY 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
@@ -1729,7 +1729,7 @@ ClockLatency PipeWirePlayback::getClockLatency()
*/
nanoseconds monoclock{seconds{tspec.tv_sec} + nanoseconds{tspec.tv_nsec}};
nanoseconds curtic{}, delay{};
- if(ptime.rate.denom < 1) [[unlikely]]
+ if(ptime.rate.denom < 1) UNLIKELY
{
/* 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.
@@ -1827,7 +1827,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(!pw_buf) [[unlikely]] return;
+ if(!pw_buf) UNLIKELY return;
spa_data *bufdata{pw_buf->buffer->datas};
const uint offset{minu(bufdata->chunk->offset, bufdata->maxsize)};