introspect: improve info updates

The current _info_update() methods will always reset the change_mask in
the new info structure.

This causes problems if multiple updates are applied to the info before
the rescan in the session manager of pulse-server is excuted. The first
update is cleared and this causes the session manager to sometimes miss
the state changes of nodes and fail to suspend them.

Add a new method to merge with optional reset of the various
introspection info structures. We can use this instead and simply
accumulate all changes until the rescan code has processed all changes.
This commit is contained in:
Wim Taymans 2021-09-03 13:26:15 +02:00
parent 63521c1063
commit 91f1b44499
11 changed files with 155 additions and 61 deletions

View file

@ -51,11 +51,14 @@ struct pw_module_info {
struct spa_dict *props; /**< extra properties */
};
/** Update and existing \ref pw_module_info with \a update */
/** Update and existing \ref pw_module_info with \a update with reset */
struct pw_module_info *
pw_module_info_update(struct pw_module_info *info,
const struct pw_module_info *update);
const struct pw_module_info *update);
/** Merge and existing \ref pw_module_info with \a update */
struct pw_module_info *
pw_module_info_merge(struct pw_module_info *info,
const struct pw_module_info *update, bool reset);
/** Free a \ref pw_module_info */
void pw_module_info_free(struct pw_module_info *info);