mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-17 08:56:49 -05:00
small optimizations
Add some SPA_LIKELY Enable FASTPATH by default
This commit is contained in:
parent
57f84ae5ae
commit
8a2af908a7
11 changed files with 55 additions and 44 deletions
|
|
@ -817,7 +817,6 @@ static int impl_node_process(void *object)
|
|||
const void **src_datas;
|
||||
void **dst_datas;
|
||||
uint32_t i, n_src_datas, n_dst_datas;
|
||||
int res = 0;
|
||||
uint32_t n_samples, size, maxsize, offs;
|
||||
|
||||
spa_return_val_if_fail(this != NULL, -EINVAL);
|
||||
|
|
@ -837,19 +836,19 @@ static int impl_node_process(void *object)
|
|||
inio, inio->status, inio->buffer_id,
|
||||
outio, outio->status, outio->buffer_id);
|
||||
|
||||
if (outio->status == SPA_STATUS_HAVE_DATA)
|
||||
if (SPA_UNLIKELY(outio->status == SPA_STATUS_HAVE_DATA))
|
||||
return inio->status | outio->status;
|
||||
|
||||
if (outio->buffer_id < outport->n_buffers) {
|
||||
if (SPA_LIKELY(outio->buffer_id < outport->n_buffers)) {
|
||||
recycle_buffer(this, outport, outio->buffer_id);
|
||||
outio->buffer_id = SPA_ID_INVALID;
|
||||
}
|
||||
if (inio->status != SPA_STATUS_HAVE_DATA)
|
||||
if (SPA_UNLIKELY(inio->status != SPA_STATUS_HAVE_DATA))
|
||||
return SPA_STATUS_NEED_DATA;
|
||||
if (inio->buffer_id >= inport->n_buffers)
|
||||
if (SPA_UNLIKELY(inio->buffer_id >= inport->n_buffers))
|
||||
return inio->status = -EINVAL;
|
||||
|
||||
if ((outbuf = dequeue_buffer(this, outport)) == NULL)
|
||||
if (SPA_UNLIKELY((outbuf = dequeue_buffer(this, outport)) == NULL))
|
||||
return outio->status = -EPIPE;
|
||||
|
||||
inbuf = &inport->buffers[inio->buffer_id];
|
||||
|
|
@ -891,13 +890,11 @@ static int impl_node_process(void *object)
|
|||
convert_process(&this->conv, dst_datas, src_datas, n_samples);
|
||||
|
||||
inio->status = SPA_STATUS_NEED_DATA;
|
||||
res |= SPA_STATUS_NEED_DATA;
|
||||
|
||||
outio->status = SPA_STATUS_HAVE_DATA;
|
||||
outio->buffer_id = outbuf->id;
|
||||
res |= SPA_STATUS_HAVE_DATA;
|
||||
|
||||
return res;
|
||||
return SPA_STATUS_NEED_DATA | SPA_STATUS_HAVE_DATA;
|
||||
}
|
||||
|
||||
static const struct spa_node_methods impl_node = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue