mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
impl-port: swap io areas instead of doing cycle math
Instead of doing (cycle+1) & 1 for output ports, simply swap the io areas depending on the port direction (0 = input, 1 = output) and just to cycle&1 for all ports.
This commit is contained in:
parent
03d62dc756
commit
fac0d47c23
4 changed files with 14 additions and 15 deletions
|
|
@ -726,8 +726,8 @@ static int do_port_set_io(struct spa_loop *loop, bool async, uint32_t seq,
|
|||
struct io_info *info = user_data;
|
||||
if (info->size >= sizeof(struct spa_io_async_buffers)) {
|
||||
struct spa_io_async_buffers *ab = info->data;
|
||||
info->port->io[0] = &ab->buffers[0];
|
||||
info->port->io[1] = &ab->buffers[1];
|
||||
info->port->io[0] = &ab->buffers[info->port->direction];
|
||||
info->port->io[1] = &ab->buffers[info->port->direction^1];
|
||||
} else if (info->size >= sizeof(struct spa_io_buffers)) {
|
||||
info->port->io[0] = info->data;
|
||||
info->port->io[1] = info->data;
|
||||
|
|
|
|||
|
|
@ -661,8 +661,8 @@ static int do_port_set_io(struct spa_loop *loop, bool async, uint32_t seq,
|
|||
struct io_info *info = user_data;
|
||||
if (info->size >= sizeof(struct spa_io_async_buffers)) {
|
||||
struct spa_io_async_buffers *ab = info->data;
|
||||
info->port->io[0] = &ab->buffers[0];
|
||||
info->port->io[1] = &ab->buffers[1];
|
||||
info->port->io[0] = &ab->buffers[info->port->direction];
|
||||
info->port->io[1] = &ab->buffers[info->port->direction^1];
|
||||
} else if (info->size >= sizeof(struct spa_io_buffers)) {
|
||||
info->port->io[0] = info->data;
|
||||
info->port->io[1] = info->data;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue