mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-04-01 07:15:39 -04:00
Merge branch 'bugfix/clean-up-io-structure-on-node-pause' into 'master'
Clean up port's io struct when node is paused Closes #5190 See merge request pipewire/pipewire!2760
This commit is contained in:
commit
bb7619f526
2 changed files with 30 additions and 17 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);
|
||||
|
|
@ -1592,8 +1594,13 @@ int impl_node_send_command(void *object, const struct spa_command *command)
|
|||
}
|
||||
case SPA_NODE_COMMAND_Pause:
|
||||
case SPA_NODE_COMMAND_Suspend:
|
||||
if ((res = spa_libcamera_stream_off(impl)) < 0)
|
||||
return res;
|
||||
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