diff --git a/spa/include/spa/pod/filter.h b/spa/include/spa/pod/filter.h index d5fe18d24..6e238c2e6 100644 --- a/spa/include/spa/pod/filter.h +++ b/spa/include/spa/pod/filter.h @@ -294,7 +294,7 @@ SPA_API_POD_FILTER int spa_pod_filter_part(struct spa_pod_builder *b, res = spa_pod_filter_prop(b, p1, p2); else if (SPA_FLAG_IS_SET(p1->flags, SPA_POD_PROP_FLAG_MANDATORY)) res = -EINVAL; - else + else if (!SPA_FLAG_IS_SET(p1->flags, SPA_POD_PROP_FLAG_DROP)) spa_pod_builder_raw_padded(b, p1, SPA_POD_PROP_SIZE(p1)); if (res < 0) break; @@ -307,7 +307,7 @@ SPA_API_POD_FILTER int spa_pod_filter_part(struct spa_pod_builder *b, continue; if (SPA_FLAG_IS_SET(p2->flags, SPA_POD_PROP_FLAG_MANDATORY)) res = -EINVAL; - else + else if (!SPA_FLAG_IS_SET(p2->flags, SPA_POD_PROP_FLAG_DROP)) spa_pod_builder_raw_padded(b, p2, SPA_POD_PROP_SIZE(p2)); if (res < 0) break; diff --git a/spa/include/spa/pod/pod.h b/spa/include/spa/pod/pod.h index 91c4d57ce..e20990cc6 100644 --- a/spa/include/spa/pod/pod.h +++ b/spa/include/spa/pod/pod.h @@ -201,8 +201,11 @@ struct spa_pod_prop { * Int : n_items, * (String : key, * String : value)*)) */ -#define SPA_POD_PROP_FLAG_MANDATORY (1u<<3) /**< is mandatory */ +#define SPA_POD_PROP_FLAG_MANDATORY (1u<<3) /**< is mandatory, when filtering, both sides + * need this property or filtering fails. */ #define SPA_POD_PROP_FLAG_DONT_FIXATE (1u<<4) /**< choices need no fixation */ +#define SPA_POD_PROP_FLAG_DROP (1u<<5) /**< drop property, when filtering, both sides + * need the property or it will be dropped. */ uint32_t flags; /**< flags for property */ struct spa_pod value; /* value follows */