handle NULL latency param

Fixes #3504
This commit is contained in:
Wim Taymans 2023-09-13 11:13:48 +02:00
parent 56786aedc4
commit b094057b0b
12 changed files with 20 additions and 13 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;