From fa2d87792547a70642e47e267f9444b15c648b2f Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 16 Jan 2019 17:39:08 +0100 Subject: [PATCH] audiotestsrc: use macros for parser --- spa/plugins/audiotestsrc/audiotestsrc.c | 12 ++++++------ spa/plugins/test/fakesink.c | 2 +- spa/plugins/volume/volume.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/spa/plugins/audiotestsrc/audiotestsrc.c b/spa/plugins/audiotestsrc/audiotestsrc.c index 5330de9ce..1c2d92664 100644 --- a/spa/plugins/audiotestsrc/audiotestsrc.c +++ b/spa/plugins/audiotestsrc/audiotestsrc.c @@ -254,10 +254,10 @@ static int impl_node_set_param(struct spa_node *node, uint32_t id, uint32_t flag } spa_pod_parse_object(param, SPA_TYPE_OBJECT_Props, NULL, - SPA_PROP_live, "?b", &p->live, - SPA_PROP_waveType, "?i", &p->wave, - SPA_PROP_frequency, "?d", &p->freq, - SPA_PROP_volume, "?d", &p->volume); + SPA_PROP_live, SPA_POD_OPT_Bool(&p->live), + SPA_PROP_waveType, SPA_POD_OPT_Int(&p->wave), + SPA_PROP_frequency, SPA_POD_OPT_Float(&p->freq), + SPA_PROP_volume, SPA_POD_OPT_Float(&p->volume)); if (p->live) this->info.flags |= SPA_PORT_INFO_FLAG_LIVE; @@ -925,8 +925,8 @@ static int process_control(struct impl *this, struct spa_pod_sequence *sequence) struct props *p = &this->props; spa_pod_parse_object(&c->value, SPA_TYPE_OBJECT_Props, NULL, - SPA_PROP_frequency, "?f", &p->freq, - SPA_PROP_volume, "?f", &p->volume); + SPA_PROP_frequency, SPA_POD_OPT_Float(&p->freq), + SPA_PROP_volume, SPA_POD_OPT_Float(&p->volume)); break; } default: diff --git a/spa/plugins/test/fakesink.c b/spa/plugins/test/fakesink.c index 47bdffb08..f3c3362f7 100644 --- a/spa/plugins/test/fakesink.c +++ b/spa/plugins/test/fakesink.c @@ -167,7 +167,7 @@ static int impl_node_set_param(struct spa_node *node, uint32_t id, uint32_t flag } spa_pod_parse_object(param, SPA_TYPE_OBJECT_Props, NULL, - SPA_PROP_live, "?b", &this->props.live); + SPA_PROP_live, SPA_POD_OPT_Bool(&this->props.live)); if (this->props.live) this->info.flags |= SPA_PORT_INFO_FLAG_LIVE; diff --git a/spa/plugins/volume/volume.c b/spa/plugins/volume/volume.c index 0f04e4431..cc882aec0 100644 --- a/spa/plugins/volume/volume.c +++ b/spa/plugins/volume/volume.c @@ -207,8 +207,8 @@ static int impl_node_set_param(struct spa_node *node, uint32_t id, uint32_t flag } spa_pod_parse_object(param, SPA_TYPE_OBJECT_Props, NULL, - SPA_PROP_volume, "?d", &p->volume, - SPA_PROP_mute, "?b", &p->mute); + SPA_PROP_volume, SPA_POD_OPT_Float(&p->volume), + SPA_PROP_mute, SPA_POD_OPT_Bool(&p->mute)); break; } default: