spa: improve filter Enum and None results

When we construct an Enum, check if we only added 1 value and remove the
duplicate default value we added. If we added more values, promote the
choice to an enum.
This commit is contained in:
Wim Taymans 2025-03-25 16:17:38 +01:00
parent 4ddb17c4b5
commit 437e486d6e
2 changed files with 30 additions and 28 deletions

View file

@ -156,6 +156,14 @@ SPA_API_POD_BUILDER int spa_pod_builder_raw(struct spa_pod_builder *builder, con
return res;
}
SPA_API_POD_BUILDER void spa_pod_builder_remove(struct spa_pod_builder *builder, uint32_t size)
{
struct spa_pod_frame *f;
builder->state.offset -= size;
for (f = builder->state.frame; f ; f = f->parent)
f->pod.size -= size;
}
SPA_API_POD_BUILDER int spa_pod_builder_pad(struct spa_pod_builder *builder, uint32_t size)
{
uint64_t zeroes = 0;