mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
Use SPA_IO_BUFFERS_INIT when we can
We should not have to initialize the state to NEED_DATA, anything that is not HAVE_DATA is good. Also we need to set the buffer to INVALID because else it might be recycled.
This commit is contained in:
parent
07f935a5ed
commit
acccccd2c0
6 changed files with 7 additions and 13 deletions
|
|
@ -169,7 +169,7 @@ static int link_io(struct impl *this)
|
||||||
res, spa_strerror(res));
|
res, spa_strerror(res));
|
||||||
}
|
}
|
||||||
|
|
||||||
spa_zero(this->io_buffers);
|
this->io_buffers = SPA_IO_BUFFERS_INIT;
|
||||||
|
|
||||||
if ((res = spa_node_port_set_io(this->follower,
|
if ((res = spa_node_port_set_io(this->follower,
|
||||||
this->direction, 0,
|
this->direction, 0,
|
||||||
|
|
|
||||||
|
|
@ -143,8 +143,7 @@ static int make_link(struct impl *this,
|
||||||
l->in_port = in_port;
|
l->in_port = in_port;
|
||||||
l->in_flags = 0;
|
l->in_flags = 0;
|
||||||
l->negotiated = false;
|
l->negotiated = false;
|
||||||
l->io.status = SPA_STATUS_NEED_DATA;
|
l->io = SPA_IO_BUFFERS_INIT;
|
||||||
l->io.buffer_id = SPA_ID_INVALID;
|
|
||||||
l->n_buffers = 0;
|
l->n_buffers = 0;
|
||||||
l->min_buffers = min_buffers;
|
l->min_buffers = min_buffers;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@ static int link_io(struct impl *this)
|
||||||
res, spa_strerror(res));
|
res, spa_strerror(res));
|
||||||
}
|
}
|
||||||
|
|
||||||
spa_zero(this->io_buffers);
|
this->io_buffers = SPA_IO_BUFFERS_INIT;
|
||||||
|
|
||||||
if ((res = spa_node_port_set_io(this->follower,
|
if ((res = spa_node_port_set_io(this->follower,
|
||||||
this->direction, 0,
|
this->direction, 0,
|
||||||
|
|
|
||||||
|
|
@ -1110,8 +1110,7 @@ struct pw_impl_link *pw_context_create_link(struct pw_context *context,
|
||||||
this->info.format = NULL;
|
this->info.format = NULL;
|
||||||
this->info.props = &this->properties->dict;
|
this->info.props = &this->properties->dict;
|
||||||
|
|
||||||
impl->io.buffer_id = SPA_ID_INVALID;
|
impl->io = SPA_IO_BUFFERS_INIT;
|
||||||
impl->io.status = SPA_STATUS_NEED_DATA;
|
|
||||||
|
|
||||||
pw_impl_port_init_mix(output, &this->rt.out_mix);
|
pw_impl_port_init_mix(output, &this->rt.out_mix);
|
||||||
pw_impl_port_init_mix(input, &this->rt.in_mix);
|
pw_impl_port_init_mix(input, &this->rt.in_mix);
|
||||||
|
|
|
||||||
|
|
@ -430,8 +430,6 @@ struct pw_impl_port *pw_context_create_port(
|
||||||
|
|
||||||
pw_map_init(&this->mix_port_map, 64, 64);
|
pw_map_init(&this->mix_port_map, 64, 64);
|
||||||
|
|
||||||
this->rt.io.status = SPA_STATUS_NEED_DATA;
|
|
||||||
|
|
||||||
if (info)
|
if (info)
|
||||||
update_info(this, info);
|
update_info(this, info);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -379,13 +379,11 @@ static int impl_send_command(void *object, const struct spa_command *command)
|
||||||
if (stream->state == PW_STREAM_STATE_PAUSED) {
|
if (stream->state == PW_STREAM_STATE_PAUSED) {
|
||||||
pw_log_debug(NAME" %p: start %d", stream, impl->direction);
|
pw_log_debug(NAME" %p: start %d", stream, impl->direction);
|
||||||
|
|
||||||
if (impl->direction == SPA_DIRECTION_INPUT) {
|
if (impl->direction == SPA_DIRECTION_INPUT)
|
||||||
impl->io->status = SPA_STATUS_NEED_DATA;
|
impl->io->status = SPA_STATUS_NEED_DATA;
|
||||||
impl->io->buffer_id = SPA_ID_INVALID;
|
else
|
||||||
}
|
|
||||||
else {
|
|
||||||
call_process(impl);
|
call_process(impl);
|
||||||
}
|
|
||||||
stream_set_state(stream, PW_STREAM_STATE_STREAMING, NULL);
|
stream_set_state(stream, PW_STREAM_STATE_STREAMING, NULL);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue