mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
stream: allow NULL param and 0 buffers in disconnect
When we are disconnecting, cleanup code might clear the params and buffers, make sure we allow this to happen and the call the right callbacks.
This commit is contained in:
parent
7f60ebff27
commit
fbaa4ddedd
2 changed files with 8 additions and 8 deletions
|
|
@ -611,8 +611,8 @@ static int impl_port_set_param(void *object,
|
||||||
struct port *port;
|
struct port *port;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
if (impl->disconnecting)
|
if (impl->disconnecting && param != NULL)
|
||||||
return param == NULL ? 0 : -EIO;
|
return -EIO;
|
||||||
|
|
||||||
pw_log_debug(NAME" %p: param changed: %p %d", impl, param, impl->disconnecting);
|
pw_log_debug(NAME" %p: param changed: %p %d", impl, param, impl->disconnecting);
|
||||||
|
|
||||||
|
|
@ -650,8 +650,8 @@ static int impl_port_use_buffers(void *object,
|
||||||
int prot, res;
|
int prot, res;
|
||||||
int size = 0;
|
int size = 0;
|
||||||
|
|
||||||
if (impl->disconnecting)
|
if (impl->disconnecting && n_buffers > 0)
|
||||||
return n_buffers == 0 ? 0 : -EIO;
|
return -EIO;
|
||||||
|
|
||||||
if ((port = get_port(impl, direction, port_id)) == NULL)
|
if ((port = get_port(impl, direction, port_id)) == NULL)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
|
||||||
|
|
@ -610,8 +610,8 @@ static int impl_port_set_param(void *object,
|
||||||
struct pw_stream *stream = &impl->this;
|
struct pw_stream *stream = &impl->this;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
if (impl->disconnecting)
|
if (impl->disconnecting && param != NULL)
|
||||||
return param == NULL ? 0 : -EIO;
|
return -EIO;
|
||||||
|
|
||||||
pw_log_debug(NAME" %p: param id %d (%s) changed: %p", impl, id,
|
pw_log_debug(NAME" %p: param id %d (%s) changed: %p", impl, id,
|
||||||
spa_debug_type_find_name(spa_type_param, id), param);
|
spa_debug_type_find_name(spa_type_param, id), param);
|
||||||
|
|
@ -646,8 +646,8 @@ static int impl_port_use_buffers(void *object,
|
||||||
int prot, res;
|
int prot, res;
|
||||||
int size = 0;
|
int size = 0;
|
||||||
|
|
||||||
if (impl->disconnecting)
|
if (impl->disconnecting && n_buffers > 0)
|
||||||
return n_buffers == 0 ? 0 : -EIO;
|
return -EIO;
|
||||||
|
|
||||||
prot = PROT_READ | (direction == SPA_DIRECTION_OUTPUT ? PROT_WRITE : 0);
|
prot = PROT_READ | (direction == SPA_DIRECTION_OUTPUT ? PROT_WRITE : 0);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue