diff --git a/spa/plugins/alsa/alsa-acp-device.c b/spa/plugins/alsa/alsa-acp-device.c index ac26190e1..809c7e0bc 100644 --- a/spa/plugins/alsa/alsa-acp-device.c +++ b/spa/plugins/alsa/alsa-acp-device.c @@ -219,6 +219,7 @@ static int emit_info(struct impl *this, bool full) const struct acp_dict_item *it; struct acp_card *card = this->card; char path[128]; + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; @@ -247,7 +248,7 @@ static int emit_info(struct impl *this, bool full) } } spa_device_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } return err; } diff --git a/spa/plugins/alsa/alsa-pcm-sink.c b/spa/plugins/alsa/alsa-pcm-sink.c index d24fdf83f..f7cf256e9 100644 --- a/spa/plugins/alsa/alsa-pcm-sink.c +++ b/spa/plugins/alsa/alsa-pcm-sink.c @@ -273,6 +273,8 @@ static int impl_node_send_command(void *object, const struct spa_command *comman static void emit_node_info(struct state *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; + if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { @@ -290,18 +292,20 @@ static void emit_node_info(struct state *this, bool full) this->info.props = &SPA_DICT_INIT(items, n_items); spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + + this->info.change_mask = old; } } static void emit_port_info(struct state *this, bool full) { + uint64_t old = full ? this->port_info.change_mask : 0; if (full) this->port_info.change_mask = this->port_info_all; if (this->port_info.change_mask) { spa_node_emit_port_info(&this->hooks, SPA_DIRECTION_INPUT, 0, &this->port_info); - this->port_info.change_mask = 0; + this->port_info.change_mask = old; } } diff --git a/spa/plugins/alsa/alsa-pcm-source.c b/spa/plugins/alsa/alsa-pcm-source.c index 128ebae34..e1c9b23fb 100644 --- a/spa/plugins/alsa/alsa-pcm-source.c +++ b/spa/plugins/alsa/alsa-pcm-source.c @@ -274,6 +274,7 @@ static int impl_node_send_command(void *object, const struct spa_command *comman static void emit_node_info(struct state *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { @@ -291,18 +292,19 @@ static void emit_node_info(struct state *this, bool full) this->info.props = &SPA_DICT_INIT(items, n_items); spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } static void emit_port_info(struct state *this, bool full) { + uint64_t old = full ? this->port_info.change_mask : 0; if (full) this->port_info.change_mask = this->port_info_all; if (this->port_info.change_mask) { spa_node_emit_port_info(&this->hooks, SPA_DIRECTION_OUTPUT, 0, &this->port_info); - this->port_info.change_mask = 0; + this->port_info.change_mask = old; } } diff --git a/spa/plugins/alsa/alsa-seq-bridge.c b/spa/plugins/alsa/alsa-seq-bridge.c index 85556449c..513d80e40 100644 --- a/spa/plugins/alsa/alsa-seq-bridge.c +++ b/spa/plugins/alsa/alsa-seq-bridge.c @@ -214,12 +214,13 @@ static const struct spa_dict_item node_info_items[] = { static void emit_node_info(struct seq_state *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { this->info.props = &SPA_DICT_INIT_ARRAY(node_info_items); spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } @@ -234,6 +235,7 @@ static inline void clean_name(char *name) static void emit_port_info(struct seq_state *this, struct seq_port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { @@ -286,7 +288,7 @@ static void emit_port_info(struct seq_state *this, struct seq_port *port, bool f spa_node_emit_port_info(&this->hooks, port->direction, port->id, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/spa/plugins/alsa/alsa-udev.c b/spa/plugins/alsa/alsa-udev.c index b987ee393..90b80c59e 100644 --- a/spa/plugins/alsa/alsa-udev.c +++ b/spa/plugins/alsa/alsa-udev.c @@ -641,12 +641,13 @@ static const struct spa_dict_item device_info_items[] = { static void emit_device_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { this->info.props = &SPA_DICT_INIT_ARRAY(device_info_items); spa_device_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } diff --git a/spa/plugins/audioconvert/audioadapter.c b/spa/plugins/audioconvert/audioadapter.c index a8067b8f6..f2d581672 100644 --- a/spa/plugins/audioconvert/audioadapter.c +++ b/spa/plugins/audioconvert/audioadapter.c @@ -217,6 +217,7 @@ static int link_io(struct impl *this) static void emit_node_info(struct impl *this, bool full) { uint32_t i; + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; @@ -230,7 +231,7 @@ static void emit_node_info(struct impl *this, bool full) } } spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } diff --git a/spa/plugins/audioconvert/audioconvert.c b/spa/plugins/audioconvert/audioconvert.c index 3588cba49..3a642e46e 100644 --- a/spa/plugins/audioconvert/audioconvert.c +++ b/spa/plugins/audioconvert/audioconvert.c @@ -128,6 +128,7 @@ struct impl { static void emit_node_info(struct impl *this, bool full) { uint32_t i; + uint64_t old = full ? this->info.change_mask : 0; if (this->add_listener) return; @@ -144,7 +145,7 @@ static void emit_node_info(struct impl *this, bool full) } } spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } diff --git a/spa/plugins/audioconvert/channelmix.c b/spa/plugins/audioconvert/channelmix.c index c1a39660e..7cfe7193e 100644 --- a/spa/plugins/audioconvert/channelmix.c +++ b/spa/plugins/audioconvert/channelmix.c @@ -178,11 +178,12 @@ struct impl { static void emit_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } @@ -639,12 +640,13 @@ static int impl_node_send_command(void *object, const struct spa_command *comman static void emit_port_info(struct impl *this, struct port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { spa_node_emit_port_info(&this->hooks, port->direction, port->id, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/spa/plugins/audioconvert/fmtconvert.c b/spa/plugins/audioconvert/fmtconvert.c index f9518860d..ccc447ad9 100644 --- a/spa/plugins/audioconvert/fmtconvert.c +++ b/spa/plugins/audioconvert/fmtconvert.c @@ -273,22 +273,24 @@ static int impl_node_send_command(void *object, const struct spa_command *comman static void emit_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } static void emit_port_info(struct impl *this, struct port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { spa_node_emit_port_info(&this->hooks, port->direction, port->id, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/spa/plugins/audioconvert/merger.c b/spa/plugins/audioconvert/merger.c index a297b13ce..401a16262 100644 --- a/spa/plugins/audioconvert/merger.c +++ b/spa/plugins/audioconvert/merger.c @@ -189,16 +189,18 @@ struct impl { static void emit_node_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } static void emit_port_info(struct impl *this, struct port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { @@ -214,7 +216,7 @@ static void emit_port_info(struct impl *this, struct port *port, bool full) port->info.props = &SPA_DICT_INIT(items, n_items); spa_node_emit_port_info(&this->hooks, port->direction, port->id, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/spa/plugins/audioconvert/resample.c b/spa/plugins/audioconvert/resample.c index 3e769bd64..ef49d6f47 100644 --- a/spa/plugins/audioconvert/resample.c +++ b/spa/plugins/audioconvert/resample.c @@ -311,23 +311,24 @@ static int impl_node_send_command(void *object, const struct spa_command *comman static void emit_node_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; - if (this->info.change_mask) { spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } static void emit_port_info(struct impl *this, struct port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { spa_node_emit_port_info(&this->hooks, port->direction, port->id, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/spa/plugins/audioconvert/splitter.c b/spa/plugins/audioconvert/splitter.c index a1c3c999b..a62fdd97f 100644 --- a/spa/plugins/audioconvert/splitter.c +++ b/spa/plugins/audioconvert/splitter.c @@ -140,21 +140,23 @@ struct impl { static void emit_node_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } static void emit_port_info(struct impl *this, struct port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { spa_node_emit_port_info(&this->hooks, port->direction, port->id, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/spa/plugins/audioconvert/test-source.c b/spa/plugins/audioconvert/test-source.c index 4194dbe8b..5663ba409 100644 --- a/spa/plugins/audioconvert/test-source.c +++ b/spa/plugins/audioconvert/test-source.c @@ -122,22 +122,24 @@ struct impl { static void emit_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } static void emit_port_info(struct impl *this, struct port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { spa_node_emit_port_info(&this->hooks, port->direction, port->id, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/spa/plugins/audiomixer/audiomixer.c b/spa/plugins/audiomixer/audiomixer.c index 4c058934b..075397761 100644 --- a/spa/plugins/audiomixer/audiomixer.c +++ b/spa/plugins/audiomixer/audiomixer.c @@ -172,22 +172,24 @@ static int impl_node_send_command(void *object, const struct spa_command *comman static void emit_node_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } static void emit_port_info(struct impl *this, struct port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { spa_node_emit_port_info(&this->hooks, port->direction, port->id, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/spa/plugins/audiomixer/mixer-dsp.c b/spa/plugins/audiomixer/mixer-dsp.c index 5fdbc9388..5a7364327 100644 --- a/spa/plugins/audiomixer/mixer-dsp.c +++ b/spa/plugins/audiomixer/mixer-dsp.c @@ -176,22 +176,24 @@ static int impl_node_send_command(void *object, const struct spa_command *comman static void emit_node_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } static void emit_port_info(struct impl *this, struct port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { spa_node_emit_port_info(&this->hooks, port->direction, port->id, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/spa/plugins/audiotestsrc/audiotestsrc.c b/spa/plugins/audiotestsrc/audiotestsrc.c index dace30675..ebaba714b 100644 --- a/spa/plugins/audiotestsrc/audiotestsrc.c +++ b/spa/plugins/audiotestsrc/audiotestsrc.c @@ -493,23 +493,25 @@ static const struct spa_dict_item node_info_items[] = { static void emit_node_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { this->info.props = &SPA_DICT_INIT_ARRAY(node_info_items); spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } static void emit_port_info(struct impl *this, struct port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { spa_node_emit_port_info(&this->hooks, SPA_DIRECTION_OUTPUT, 0, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/spa/plugins/bluez5/a2dp-sink.c b/spa/plugins/bluez5/a2dp-sink.c index 37550e1a8..8e1dbcd95 100644 --- a/spa/plugins/bluez5/a2dp-sink.c +++ b/spa/plugins/bluez5/a2dp-sink.c @@ -881,23 +881,25 @@ static const struct spa_dict_item node_info_items[] = { static void emit_node_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { this->info.props = &SPA_DICT_INIT_ARRAY(node_info_items); spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } static void emit_port_info(struct impl *this, struct port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { spa_node_emit_port_info(&this->hooks, SPA_DIRECTION_INPUT, 0, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/spa/plugins/bluez5/a2dp-source.c b/spa/plugins/bluez5/a2dp-source.c index 6a243d702..b9963a57c 100644 --- a/spa/plugins/bluez5/a2dp-source.c +++ b/spa/plugins/bluez5/a2dp-source.c @@ -750,6 +750,7 @@ static int impl_node_send_command(void *object, const struct spa_command *comman static void emit_node_info(struct impl *this, bool full) { char latency[64] = SPA_STRINGIFY(MIN_LATENCY)"/48000"; + uint64_t old = full ? this->info.change_mask : 0; struct spa_dict_item node_info_items[] = { { SPA_KEY_DEVICE_API, "bluez5" }, @@ -768,18 +769,19 @@ static void emit_node_info(struct impl *this, bool full) (int)this->port.current_format.info.raw.rate); this->info.props = &SPA_DICT_INIT_ARRAY(node_info_items); spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } static void emit_port_info(struct impl *this, struct port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { spa_node_emit_port_info(&this->hooks, SPA_DIRECTION_OUTPUT, 0, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/spa/plugins/bluez5/bluez5-device.c b/spa/plugins/bluez5/bluez5-device.c index 75c1f235d..9ea3366b2 100644 --- a/spa/plugins/bluez5/bluez5-device.c +++ b/spa/plugins/bluez5/bluez5-device.c @@ -603,13 +603,14 @@ static const struct spa_dict_item info_items[] = { static void emit_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { this->info.props = &SPA_DICT_INIT_ARRAY(info_items); spa_device_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } diff --git a/spa/plugins/bluez5/sco-sink.c b/spa/plugins/bluez5/sco-sink.c index e519a5142..881e1f69b 100644 --- a/spa/plugins/bluez5/sco-sink.c +++ b/spa/plugins/bluez5/sco-sink.c @@ -693,6 +693,7 @@ static void emit_node_info(struct impl *this, bool full) { SPA_KEY_MEDIA_CLASS, "Audio/Sink" }, { SPA_KEY_NODE_DRIVER, "true" }, }; + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; @@ -701,18 +702,19 @@ static void emit_node_info(struct impl *this, bool full) &SPA_DICT_INIT_ARRAY(ag_node_info_items) : &SPA_DICT_INIT_ARRAY(hu_node_info_items); spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } static void emit_port_info(struct impl *this, struct port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { spa_node_emit_port_info(&this->hooks, SPA_DIRECTION_INPUT, 0, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/spa/plugins/bluez5/sco-source.c b/spa/plugins/bluez5/sco-source.c index 517e82415..b7b36b687 100644 --- a/spa/plugins/bluez5/sco-source.c +++ b/spa/plugins/bluez5/sco-source.c @@ -723,6 +723,7 @@ static void emit_node_info(struct impl *this, bool full) { SPA_KEY_MEDIA_CLASS, "Audio/Source" }, { SPA_KEY_NODE_DRIVER, "true" }, }; + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; @@ -734,18 +735,19 @@ static void emit_node_info(struct impl *this, bool full) &SPA_DICT_INIT_ARRAY(ag_node_info_items) : &SPA_DICT_INIT_ARRAY(hu_node_info_items); spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } static void emit_port_info(struct impl *this, struct port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { spa_node_emit_port_info(&this->hooks, SPA_DIRECTION_OUTPUT, 0, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/spa/plugins/control/mixer.c b/spa/plugins/control/mixer.c index 7774ab423..518a475ab 100644 --- a/spa/plugins/control/mixer.c +++ b/spa/plugins/control/mixer.c @@ -143,22 +143,24 @@ static int impl_node_send_command(void *object, const struct spa_command *comman static void emit_node_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } static void emit_port_info(struct impl *this, struct port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { spa_node_emit_port_info(&this->hooks, port->direction, port->id, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/spa/plugins/ffmpeg/ffmpeg-dec.c b/spa/plugins/ffmpeg/ffmpeg-dec.c index 5fd967900..245e3a872 100644 --- a/spa/plugins/ffmpeg/ffmpeg-dec.c +++ b/spa/plugins/ffmpeg/ffmpeg-dec.c @@ -131,22 +131,24 @@ static int impl_node_send_command(void *object, const struct spa_command *comman static void emit_node_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } static void emit_port_info(struct impl *this, struct port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { spa_node_emit_port_info(&this->hooks, port->direction, port->id, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/spa/plugins/ffmpeg/ffmpeg-enc.c b/spa/plugins/ffmpeg/ffmpeg-enc.c index 5c4e45afe..b9f2f277b 100644 --- a/spa/plugins/ffmpeg/ffmpeg-enc.c +++ b/spa/plugins/ffmpeg/ffmpeg-enc.c @@ -129,22 +129,24 @@ static int impl_node_send_command(void *object, const struct spa_command *comman static void emit_node_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } static void emit_port_info(struct impl *this, struct port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { spa_node_emit_port_info(&this->hooks, port->direction, port->id, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/spa/plugins/jack/jack-sink.c b/spa/plugins/jack/jack-sink.c index 36a954ed7..b35463fb7 100644 --- a/spa/plugins/jack/jack-sink.c +++ b/spa/plugins/jack/jack-sink.c @@ -251,6 +251,7 @@ static int impl_node_send_command(void *object, const struct spa_command *comman static void emit_node_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { @@ -265,12 +266,13 @@ static void emit_node_info(struct impl *this, bool full) items[4] = SPA_DICT_ITEM_INIT(SPA_KEY_NODE_LATENCY, latency); this->info.props = &SPA_DICT_INIT_ARRAY(items); spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } static void emit_port_info(struct impl *this, struct port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { @@ -292,7 +294,7 @@ static void emit_port_info(struct impl *this, struct port *port, bool full) spa_node_emit_port_info(&this->hooks, SPA_DIRECTION_INPUT, port->id, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/spa/plugins/jack/jack-source.c b/spa/plugins/jack/jack-source.c index 07212452a..aab179d56 100644 --- a/spa/plugins/jack/jack-source.c +++ b/spa/plugins/jack/jack-source.c @@ -279,6 +279,7 @@ static int impl_node_send_command(void *object, const struct spa_command *comman static void emit_node_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { @@ -293,12 +294,13 @@ static void emit_node_info(struct impl *this, bool full) items[4] = SPA_DICT_ITEM_INIT(SPA_KEY_NODE_LATENCY, latency); this->info.props = &SPA_DICT_INIT_ARRAY(items); spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } static void emit_port_info(struct impl *this, struct port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { @@ -319,7 +321,7 @@ static void emit_port_info(struct impl *this, struct port *port, bool full) spa_node_emit_port_info(&this->hooks, SPA_DIRECTION_OUTPUT, port->id, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/spa/plugins/libcamera/libcamera-client.c b/spa/plugins/libcamera/libcamera-client.c index 5bfd94873..34b8f96fe 100644 --- a/spa/plugins/libcamera/libcamera-client.c +++ b/spa/plugins/libcamera/libcamera-client.c @@ -95,12 +95,13 @@ static const struct spa_dict_item device_info_items[] = { static void emit_device_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { this->info.props = &SPA_DICT_INIT_ARRAY(device_info_items); spa_device_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } diff --git a/spa/plugins/libcamera/libcamera-source.c b/spa/plugins/libcamera/libcamera-source.c index d9e078df6..0a143a143 100644 --- a/spa/plugins/libcamera/libcamera-source.c +++ b/spa/plugins/libcamera/libcamera-source.c @@ -338,23 +338,25 @@ static const struct spa_dict_item info_items[] = { static void emit_node_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { this->info.props = &SPA_DICT_INIT_ARRAY(info_items); spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } static void emit_port_info(struct impl *this, struct port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { spa_node_emit_port_info(&this->hooks, SPA_DIRECTION_OUTPUT, 0, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/spa/plugins/support/node-driver.c b/spa/plugins/support/node-driver.c index a669ce450..34533d0d9 100644 --- a/spa/plugins/support/node-driver.c +++ b/spa/plugins/support/node-driver.c @@ -192,12 +192,13 @@ static const struct spa_dict_item node_info_items[] = { static void emit_node_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { this->info.props = &SPA_DICT_INIT_ARRAY(node_info_items); spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } diff --git a/spa/plugins/support/null-audio-sink.c b/spa/plugins/support/null-audio-sink.c index 694d0f60a..e9588f1e2 100644 --- a/spa/plugins/support/null-audio-sink.c +++ b/spa/plugins/support/null-audio-sink.c @@ -299,23 +299,25 @@ static const struct spa_dict_item node_info_items[] = { static void emit_node_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { this->info.props = &SPA_DICT_INIT_ARRAY(node_info_items); spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } static void emit_port_info(struct impl *this, struct port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { spa_node_emit_port_info(&this->hooks, SPA_DIRECTION_INPUT, 0, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/spa/plugins/test/fakesink.c b/spa/plugins/test/fakesink.c index 4eec11b43..7dcf8e57a 100644 --- a/spa/plugins/test/fakesink.c +++ b/spa/plugins/test/fakesink.c @@ -337,22 +337,24 @@ static int impl_node_send_command(void *object, const struct spa_command *comman static void emit_node_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } static void emit_port_info(struct impl *this, struct port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { spa_node_emit_port_info(&this->hooks, SPA_DIRECTION_INPUT, 0, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/spa/plugins/test/fakesrc.c b/spa/plugins/test/fakesrc.c index bc6818e63..c12941c31 100644 --- a/spa/plugins/test/fakesrc.c +++ b/spa/plugins/test/fakesrc.c @@ -352,22 +352,24 @@ static int impl_node_send_command(void *object, const struct spa_command *comman static void emit_node_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } static void emit_port_info(struct impl *this, struct port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { spa_node_emit_port_info(&this->hooks, SPA_DIRECTION_OUTPUT, 0, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/spa/plugins/v4l2/v4l2-source.c b/spa/plugins/v4l2/v4l2-source.c index f435389c6..a6e9c3f94 100644 --- a/spa/plugins/v4l2/v4l2-source.c +++ b/spa/plugins/v4l2/v4l2-source.c @@ -333,23 +333,25 @@ static const struct spa_dict_item info_items[] = { static void emit_node_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { this->info.props = &SPA_DICT_INIT_ARRAY(info_items); spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } static void emit_port_info(struct impl *this, struct port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { spa_node_emit_port_info(&this->hooks, SPA_DIRECTION_OUTPUT, 0, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/spa/plugins/v4l2/v4l2-udev.c b/spa/plugins/v4l2/v4l2-udev.c index e93565d08..10f909ee0 100644 --- a/spa/plugins/v4l2/v4l2-udev.c +++ b/spa/plugins/v4l2/v4l2-udev.c @@ -589,12 +589,13 @@ static const struct spa_dict_item device_info_items[] = { static void emit_device_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { this->info.props = &SPA_DICT_INIT_ARRAY(device_info_items); spa_device_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } diff --git a/spa/plugins/videoconvert/videoadapter.c b/spa/plugins/videoconvert/videoadapter.c index 68d24785e..92524ac76 100644 --- a/spa/plugins/videoconvert/videoadapter.c +++ b/spa/plugins/videoconvert/videoadapter.c @@ -190,9 +190,9 @@ static int link_io(struct impl *this) static void emit_node_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; - if (this->info.change_mask) { struct spa_dict_item items[1]; @@ -201,7 +201,7 @@ static void emit_node_info(struct impl *this, bool full) this->info.props = &SPA_DICT_INIT(items, 1); spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } diff --git a/spa/plugins/videotestsrc/videotestsrc.c b/spa/plugins/videotestsrc/videotestsrc.c index ae6e35fc3..856cfd840 100644 --- a/spa/plugins/videotestsrc/videotestsrc.c +++ b/spa/plugins/videotestsrc/videotestsrc.c @@ -399,23 +399,25 @@ static const struct spa_dict_item node_info_items[] = { static void emit_node_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { this->info.props = &SPA_DICT_INIT_ARRAY(node_info_items); spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } static void emit_port_info(struct impl *this, struct port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { spa_node_emit_port_info(&this->hooks, SPA_DIRECTION_OUTPUT, 0, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/spa/plugins/volume/volume.c b/spa/plugins/volume/volume.c index 595386d54..14846f9ed 100644 --- a/spa/plugins/volume/volume.c +++ b/spa/plugins/volume/volume.c @@ -242,22 +242,24 @@ static int impl_node_send_command(void *object, const struct spa_command *comman static void emit_node_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } static void emit_port_info(struct impl *this, struct port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { spa_node_emit_port_info(&this->hooks, port->direction, port->id, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/spa/plugins/vulkan/vulkan-compute-source.c b/spa/plugins/vulkan/vulkan-compute-source.c index 90b0575ad..9ffa0c5a0 100644 --- a/spa/plugins/vulkan/vulkan-compute-source.c +++ b/spa/plugins/vulkan/vulkan-compute-source.c @@ -442,17 +442,19 @@ static const struct spa_dict_item node_info_items[] = { static void emit_node_info(struct impl *this, bool full) { + uint64_t old = full ? this->info.change_mask : 0; if (full) this->info.change_mask = this->info_all; if (this->info.change_mask) { this->info.props = &SPA_DICT_INIT_ARRAY(node_info_items); spa_node_emit_info(&this->hooks, &this->info); - this->info.change_mask = 0; + this->info.change_mask = old; } } static void emit_port_info(struct impl *this, struct port *port, bool full) { + uint64_t old = full ? port->info.change_mask : 0; if (full) port->info.change_mask = port->info_all; if (port->info.change_mask) { @@ -462,7 +464,7 @@ static void emit_port_info(struct impl *this, struct port *port, bool full) port->info.props = &SPA_DICT_INIT(items, 1); spa_node_emit_port_info(&this->hooks, SPA_DIRECTION_OUTPUT, 0, &port->info); - port->info.change_mask = 0; + port->info.change_mask = old; } } diff --git a/src/examples/export-sink.c b/src/examples/export-sink.c index 69e3656a8..e9b6c8474 100644 --- a/src/examples/export-sink.c +++ b/src/examples/export-sink.c @@ -141,13 +141,15 @@ static int impl_add_listener(void *object, { struct data *d = object; struct spa_hook_list save; + uint64_t old; spa_hook_list_isolate(&d->hooks, &save, listener, events, data); + old = d->info.change_mask; d->info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS | SPA_PORT_CHANGE_MASK_PARAMS; spa_node_emit_port_info(&d->hooks, SPA_DIRECTION_INPUT, 0, &d->info); - d->info.change_mask = 0; + d->info.change_mask = old; spa_hook_list_join(&d->hooks, &save); @@ -526,7 +528,7 @@ int main(int argc, char *argv[]) data.info = SPA_PORT_INFO_INIT(); data.info.change_mask = SPA_PORT_CHANGE_MASK_FLAGS; data.info.flags = 0; - data.info.change_mask = SPA_PORT_CHANGE_MASK_PARAMS; + data.info.change_mask |= SPA_PORT_CHANGE_MASK_PARAMS; data.params[0] = SPA_PARAM_INFO(SPA_PARAM_EnumFormat, SPA_PARAM_INFO_READ); data.params[1] = SPA_PARAM_INFO(SPA_PARAM_Meta, SPA_PARAM_INFO_READ); data.params[2] = SPA_PARAM_INFO(SPA_PARAM_IO, SPA_PARAM_INFO_READ); diff --git a/src/examples/export-source.c b/src/examples/export-source.c index 64306f351..8a85b9410 100644 --- a/src/examples/export-source.c +++ b/src/examples/export-source.c @@ -115,12 +115,14 @@ static int impl_add_listener(void *object, { struct data *d = object; struct spa_hook_list save; + uint64_t old; spa_hook_list_isolate(&d->hooks, &save, listener, events, data); + old = d->info.change_mask; d->info.change_mask = d->info_all; spa_node_emit_port_info(&d->hooks, SPA_DIRECTION_OUTPUT, 0, &d->info); - d->info.change_mask = 0; + d->info.change_mask = old; spa_hook_list_join(&d->hooks, &save); return 0; diff --git a/src/pipewire/filter.c b/src/pipewire/filter.c index 4137a9337..c6e52f6ea 100644 --- a/src/pipewire/filter.c +++ b/src/pipewire/filter.c @@ -434,20 +434,22 @@ static int impl_send_command(void *object, const struct spa_command *command) static void emit_node_info(struct filter *d, bool full) { + uint64_t old = full ? d->info.change_mask : 0; if (full) d->info.change_mask = d->change_mask_all; if (d->info.change_mask != 0) spa_node_emit_info(&d->hooks, &d->info); - d->info.change_mask = 0; + d->info.change_mask = old; } static void emit_port_info(struct filter *d, struct port *p, bool full) { + uint64_t old = full ? p->info.change_mask : 0; if (full) p->info.change_mask = p->change_mask_all; if (p->info.change_mask != 0) spa_node_emit_port_info(&d->hooks, p->direction, p->id, &p->info); - p->info.change_mask = 0; + p->info.change_mask = old; } static int impl_add_listener(void *object, @@ -1465,7 +1467,6 @@ void *pw_filter_add_port(struct pw_filter *filter, p->change_mask_all = SPA_PORT_CHANGE_MASK_FLAGS | SPA_PORT_CHANGE_MASK_PROPS; p->info = SPA_PORT_INFO_INIT(); - p->info.change_mask = 0; p->info.flags = 0; if (SPA_FLAG_IS_SET(flags, PW_FILTER_PORT_FLAG_ALLOC_BUFFERS)) p->info.flags |= SPA_PORT_FLAG_CAN_ALLOC_BUFFERS; diff --git a/src/pipewire/stream.c b/src/pipewire/stream.c index 7d515ac1a..d22d41152 100644 --- a/src/pipewire/stream.c +++ b/src/pipewire/stream.c @@ -546,20 +546,22 @@ static int impl_send_command(void *object, const struct spa_command *command) static void emit_node_info(struct stream *d, bool full) { + uint64_t old = full ? d->info.change_mask : 0; if (full) d->info.change_mask = d->change_mask_all; if (d->info.change_mask != 0) spa_node_emit_info(&d->hooks, &d->info); - d->info.change_mask = 0; + d->info.change_mask = old; } static void emit_port_info(struct stream *d, bool full) { + uint64_t old = full ? d->port_info.change_mask : 0; if (full) d->port_info.change_mask = d->port_change_mask_all; if (d->port_info.change_mask != 0) spa_node_emit_port_info(&d->hooks, d->direction, 0, &d->port_info); - d->port_info.change_mask = 0; + d->port_info.change_mask = old; } static int impl_add_listener(void *object,