On Tue, 2015-10-27 at 16:09 +0100, David Henningsson wrote: > diff --git a/src/modules/module-card-restore.c b/src/modules/module-card-restore.c > index 3725d30..b30fa36 100644 > --- a/src/modules/module-card-restore.c > +++ b/src/modules/module-card-restore.c > @@ -375,8 +385,30 @@ finish: > Â Â Â Â Â return PA_HOOK_OK; > Â } > Â > +static void update_profile_for_port(struct entry *entry, pa_card *card, pa_device_port *p) { > +Â Â Â Â struct port_info *p_info; > + > +Â Â Â Â if (p == NULL) > +Â Â Â Â Â Â Â Â return; > + > +Â Â Â Â if (!(p_info = pa_hashmap_get(entry->ports, p->name))) { > +Â Â Â Â Â Â Â Â p_info = port_info_new(p); > +Â Â Â Â Â Â Â Â pa_assert_se(pa_hashmap_put(entry->ports, p_info->name, p_info) >= 0); > +Â Â Â Â } > + > +Â Â Â Â if (!pa_safe_streq(p_info->profile, p->preferred_profile)) { > +Â Â Â Â Â Â Â Â pa_xfree(p_info->profile); > +Â Â Â Â Â Â Â Â p_info->profile = pa_xstrdup(p->preferred_profile); > +Â Â Â Â Â Â Â Â entry->version = ENTRY_VERSION; I mentioned in IRC that this is perhaps not the best place to set entry->version, and that a better place would be where we read or create the entry structs. If the entry version is updated immediately after reading the entry, we won't need to add any more version assignments every time a new field is added to the entry. --Â Tanu