Specify channels with duplicated values

This commit is contained in:
Rodrigo Arias 2023-02-16 16:04:49 +01:00 committed by Rodrigo Arias Mallo
parent 2d05fbaeea
commit 10de4c8f09
2 changed files with 6 additions and 0 deletions

View File

@ -11,6 +11,7 @@ struct model_chan_spec {
const char *prefix;
const char **ch_names;
const int *ch_stack;
const int *ch_dup;
const struct model_pvt_spec *pvt;
const int *track;
};

View File

@ -20,6 +20,11 @@ init_chan(struct model_thread *th, const struct model_chan_spec *spec, int64_t g
const char *ch_name = spec->ch_names[i];
chan_init(c, type, fmt, prefix, gindex, ch_name);
if (spec->ch_dup != NULL) {
int dup = spec->ch_dup[i];
chan_prop_set(c, CHAN_DUPLICATES, dup);
}
if (bay_register(th->bay, c) != 0) {
err("bay_register failed");
return -1;