mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-03-26 07:58:03 -04:00
clean up port's io struct when node is paused
This commit is contained in:
parent
14dd77578a
commit
48fae6fa3e
2 changed files with 15 additions and 1 deletions
|
|
@ -1571,6 +1571,8 @@ int impl_node_set_io(void *object, uint32_t id, void *data, size_t size)
|
|||
int impl_node_send_command(void *object, const struct spa_command *command)
|
||||
{
|
||||
struct impl *impl = (struct impl*)object;
|
||||
struct port *port;
|
||||
struct spa_io_buffers *io;
|
||||
int res;
|
||||
|
||||
spa_return_val_if_fail(impl != nullptr, -EINVAL);
|
||||
|
|
@ -1593,6 +1595,12 @@ int impl_node_send_command(void *object, const struct spa_command *command)
|
|||
case SPA_NODE_COMMAND_Pause:
|
||||
case SPA_NODE_COMMAND_Suspend:
|
||||
spa_libcamera_stream_off(impl);
|
||||
port = GET_OUT_PORT(impl, 0);
|
||||
io = port->io;
|
||||
if (io && (io->buffer_id < port->n_buffers)) {
|
||||
spa_libcamera_buffer_recycle(impl, port, io->buffer_id);
|
||||
io->buffer_id = SPA_ID_INVALID;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return -ENOTSUP;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue