diff --git a/spa/plugins/support/null-audio-sink.c b/spa/plugins/support/null-audio-sink.c index ad2c4db2a..98ff6562b 100644 --- a/spa/plugins/support/null-audio-sink.c +++ b/spa/plugins/support/null-audio-sink.c @@ -37,7 +37,6 @@ struct props { uint32_t format; uint32_t channels; uint32_t rate; - uint32_t n_pos; uint32_t pos[SPA_AUDIO_MAX_CHANNELS]; char clock_name[64]; unsigned int debug:1; @@ -49,7 +48,6 @@ static void reset_props(struct props *props) props->format = 0; props->channels = 0; props->rate = 0; - props->n_pos = 0; strncpy(props->clock_name, DEFAULT_CLOCK_NAME, sizeof(props->clock_name)); props->debug = false; props->driver = true; @@ -469,10 +467,10 @@ port_enum_formats(struct impl *this, SPA_FORMAT_AUDIO_channels, SPA_POD_CHOICE_RANGE_Int(DEFAULT_CHANNELS, 1, INT32_MAX), 0); } - if (this->props.n_pos != 0) { + if (this->props.channels != 0) { spa_pod_builder_prop(builder, SPA_FORMAT_AUDIO_position, 0); spa_pod_builder_array(builder, sizeof(uint32_t), SPA_TYPE_Id, - this->props.n_pos, this->props.pos); + this->props.channels, this->props.pos); } *param = spa_pod_builder_pop(builder, &f[0]); break; @@ -888,10 +886,10 @@ static inline void parse_position(struct impl *this, const char *val, size_t len if (spa_json_enter_array(&it[0], &it[1]) <= 0) spa_json_init(&it[1], val, len); - this->props.n_pos = 0; + this->props.channels = 0; while (spa_json_get_string(&it[1], v, sizeof(v)) > 0 && - this->props.n_pos < SPA_AUDIO_MAX_CHANNELS) { - this->props.pos[this->props.n_pos++] = channel_from_name(v); + this->props.channels < SPA_AUDIO_MAX_CHANNELS) { + this->props.pos[this->props.channels++] = channel_from_name(v); } } @@ -991,9 +989,6 @@ impl_init(const struct spa_handle_factory *factory, "%s", s); } } - if (this->props.n_pos > 0) - this->props.channels = this->props.n_pos; - spa_log_info(this->log, NAME " %p: initialized", this); return 0;