mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
parent
56786aedc4
commit
b094057b0b
12 changed files with 20 additions and 13 deletions
|
|
@ -2442,7 +2442,6 @@ static int port_set_latency(struct client *c, struct port *p,
|
|||
|
||||
if (param == NULL)
|
||||
return 0;
|
||||
|
||||
if ((res = spa_latency_parse(param, &info)) < 0)
|
||||
return res;
|
||||
|
||||
|
|
|
|||
|
|
@ -691,7 +691,9 @@ impl_node_port_set_param(void *object,
|
|||
case SPA_PARAM_Latency:
|
||||
{
|
||||
struct spa_latency_info info;
|
||||
if ((res = spa_latency_parse(param, &info)) < 0)
|
||||
if (param == NULL)
|
||||
info = SPA_LATENCY_INFO(SPA_DIRECTION_REVERSE(direction));
|
||||
else if ((res = spa_latency_parse(param, &info)) < 0)
|
||||
return res;
|
||||
if (direction == info.direction)
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -572,7 +572,9 @@ impl_node_port_set_param(void *object,
|
|||
case SPA_PARAM_Latency:
|
||||
{
|
||||
struct spa_latency_info info;
|
||||
if ((res = spa_latency_parse(param, &info)) < 0)
|
||||
if (param == NULL)
|
||||
info = SPA_LATENCY_INFO(SPA_DIRECTION_REVERSE(direction));
|
||||
else if ((res = spa_latency_parse(param, &info)) < 0)
|
||||
return res;
|
||||
if (direction == info.direction)
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -572,7 +572,9 @@ impl_node_port_set_param(void *object,
|
|||
case SPA_PARAM_Latency:
|
||||
{
|
||||
struct spa_latency_info info;
|
||||
if ((res = spa_latency_parse(param, &info)) < 0)
|
||||
if (param == NULL)
|
||||
info = SPA_LATENCY_INFO(SPA_DIRECTION_REVERSE(direction));
|
||||
else if ((res = spa_latency_parse(param, &info)) < 0)
|
||||
return res;
|
||||
if (direction == info.direction)
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -729,7 +729,9 @@ static int impl_node_port_set_param(void *object,
|
|||
case SPA_PARAM_Latency:
|
||||
{
|
||||
struct spa_latency_info info;
|
||||
if ((res = spa_latency_parse(param, &info)) < 0)
|
||||
if (param == NULL)
|
||||
info = SPA_LATENCY_INFO(SPA_DIRECTION_REVERSE(direction));
|
||||
else if ((res = spa_latency_parse(param, &info)) < 0)
|
||||
return res;
|
||||
if (direction == info.direction)
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -697,7 +697,7 @@ static void stream_param_changed(void *d, uint32_t id, const struct spa_pod *par
|
|||
update_delay(s->impl);
|
||||
break;
|
||||
case SPA_PARAM_Latency:
|
||||
if (!param) {
|
||||
if (param == NULL) {
|
||||
s->have_latency = false;
|
||||
} else if (spa_latency_parse(param, &latency) == 0 &&
|
||||
latency.direction == get_combine_direction(s->impl)) {
|
||||
|
|
|
|||
|
|
@ -604,7 +604,7 @@ static void input_param_latency_changed(struct impl *impl, const struct spa_pod
|
|||
struct spa_pod_builder b;
|
||||
const struct spa_pod *params[1];
|
||||
|
||||
if (spa_latency_parse(param, &latency) < 0)
|
||||
if (param == NULL || spa_latency_parse(param, &latency) < 0)
|
||||
return;
|
||||
|
||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
|
@ -767,7 +767,7 @@ static void output_param_latency_changed(struct impl *impl, const struct spa_pod
|
|||
struct spa_pod_builder b;
|
||||
const struct spa_pod *params[1];
|
||||
|
||||
if (spa_latency_parse(param, &latency) < 0)
|
||||
if (param == NULL || spa_latency_parse(param, &latency) < 0)
|
||||
return;
|
||||
|
||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ static void param_latency_changed(struct impl *impl, const struct spa_pod *param
|
|||
struct spa_pod_builder b;
|
||||
const struct spa_pod *params[1];
|
||||
|
||||
if (spa_latency_parse(param, &latency) < 0)
|
||||
if (param == NULL || spa_latency_parse(param, &latency) < 0)
|
||||
return;
|
||||
|
||||
*info = latency;
|
||||
|
|
|
|||
|
|
@ -417,7 +417,7 @@ static void param_latency_changed(struct stream *s, const struct spa_pod *param,
|
|||
bool update = false;
|
||||
enum spa_direction direction = port->direction;
|
||||
|
||||
if (spa_latency_parse(param, &latency) < 0)
|
||||
if (param == NULL || spa_latency_parse(param, &latency) < 0)
|
||||
return;
|
||||
|
||||
if (spa_latency_info_compare(&port->latency[direction], &latency)) {
|
||||
|
|
|
|||
|
|
@ -410,7 +410,7 @@ static void param_latency_changed(struct stream *s, const struct spa_pod *param,
|
|||
bool update = false;
|
||||
enum spa_direction direction = port->direction;
|
||||
|
||||
if (spa_latency_parse(param, &latency) < 0)
|
||||
if (param == NULL || spa_latency_parse(param, &latency) < 0)
|
||||
return;
|
||||
|
||||
if (spa_latency_info_compare(&port->latency[direction], &latency)) {
|
||||
|
|
|
|||
|
|
@ -371,7 +371,7 @@ static void param_latency_changed(struct stream *s, const struct spa_pod *param,
|
|||
bool update = false;
|
||||
enum spa_direction direction = port->direction;
|
||||
|
||||
if (spa_latency_parse(param, &latency) < 0)
|
||||
if (param == NULL || spa_latency_parse(param, &latency) < 0)
|
||||
return;
|
||||
|
||||
if (spa_latency_info_compare(&port->latency[direction], &latency)) {
|
||||
|
|
|
|||
|
|
@ -493,7 +493,7 @@ static void param_latency_changed(struct stream *s, const struct spa_pod *param,
|
|||
bool update = false;
|
||||
enum spa_direction direction = port->direction;
|
||||
|
||||
if (spa_latency_parse(param, &latency) < 0)
|
||||
if (param == NULL || spa_latency_parse(param, &latency) < 0)
|
||||
return;
|
||||
|
||||
if (spa_latency_info_compare(&port->latency[direction], &latency)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue