internal variables in macros should use private names
this sets the volume to 0.0:
float f = 1.0;
const struct spa_pod *param = spa_pod_builder_add_object (&b,
SPA_TYPE_OBJECT_Props, SPA_PARAM_Props,
SPA_PROP_volume, SPA_POD_Float(f));
this sets the volume to 1.0:
float vol = 1.0;
const struct spa_pod *param = spa_pod_builder_add_object (&b,
SPA_TYPE_OBJECT_Props, SPA_PARAM_Props,
SPA_PROP_volume, SPA_POD_Float(vol));
guess why ...
#define spa_pod_builder_add_object(b,type,id,...) \
({ \
struct spa_pod_frame f; \
spa_pod_builder_push_object(b, &f, type, id); \
spa_pod_builder_add(b, ##__VA_ARGS__, 0); \
spa_pod_builder_pop(b, &f); \
})
it took me a while :/