spa: respect mandatory properties while filtering

This commit is contained in:
columbarius 2021-05-20 01:22:41 +02:00 committed by Wim Taymans
parent da566c2865
commit d735d32eb3

View file

@ -301,6 +301,8 @@ static inline int spa_pod_filter_part(struct spa_pod_builder *b,
p2 = spa_pod_object_find_prop(of, p2, p1->key);
if (p2 != NULL)
res = spa_pod_filter_prop(b, p1, p2);
else if ((p1->flags & SPA_POD_PROP_FLAG_MANDATORY) != 0)
res = -EINVAL;
else
spa_pod_builder_raw_padded(b, p1, SPA_POD_PROP_SIZE(p1));
if (res < 0)
@ -312,7 +314,10 @@ static inline int spa_pod_filter_part(struct spa_pod_builder *b,
p1 = spa_pod_object_find_prop(op, p1, p2->key);
if (p1 != NULL)
continue;
if ((p2->flags & SPA_POD_PROP_FLAG_MANDATORY) != 0)
res = -EINVAL;
if (res < 0)
break;
spa_pod_builder_raw_padded(b, p2, SPA_POD_PROP_SIZE(p2));
}
}