mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	audioconvert: don't handle params when just enumerating
When we are simply enumerating the params, just collect the info but don't act on them, like clearing the format or recalculating the latency. This avoids some useless work when enumerating params. Use the more complete configure_format function to clear the format and buffers when the EnumFormat param changed.
This commit is contained in:
		
							parent
							
								
									82f7ed419c
								
							
						
					
					
						commit
						43d02410e6
					
				
					 1 changed files with 8 additions and 7 deletions
				
			
		| 
						 | 
					@ -1094,22 +1094,23 @@ static void follower_port_info(void *data,
 | 
				
			||||||
				(this->params[idx].flags & SPA_PARAM_INFO_SERIAL) |
 | 
									(this->params[idx].flags & SPA_PARAM_INFO_SERIAL) |
 | 
				
			||||||
				(info->params[i].flags & SPA_PARAM_INFO_READWRITE);
 | 
									(info->params[i].flags & SPA_PARAM_INFO_READWRITE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								this->info.change_mask |= SPA_NODE_CHANGE_MASK_PARAMS;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								if (this->add_listener)
 | 
				
			||||||
 | 
									continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if (idx == IDX_Latency) {
 | 
								if (idx == IDX_Latency) {
 | 
				
			||||||
				res = recalc_latency(this, direction, port_id);
 | 
									res = recalc_latency(this, direction, port_id);
 | 
				
			||||||
				spa_log_debug(this->log, "latency: %d (%s)", res,
 | 
									spa_log_debug(this->log, "latency: %d (%s)", res,
 | 
				
			||||||
						spa_strerror(res));
 | 
											spa_strerror(res));
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			if (idx == IDX_EnumFormat) {
 | 
								if (idx == IDX_EnumFormat) {
 | 
				
			||||||
				this->have_format = false;
 | 
					 | 
				
			||||||
				this->n_buffers = 0;
 | 
					 | 
				
			||||||
				spa_log_debug(this->log, "new formats");
 | 
									spa_log_debug(this->log, "new formats");
 | 
				
			||||||
 | 
									configure_format(this, 0, NULL);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			this->info.change_mask |= SPA_NODE_CHANGE_MASK_PARAMS;
 | 
								this->params[idx].user++;
 | 
				
			||||||
			if (!this->add_listener) {
 | 
								spa_log_debug(this->log, "param %d changed", info->params[i].id);
 | 
				
			||||||
				this->params[idx].user++;
 | 
					 | 
				
			||||||
				spa_log_debug(this->log, "param %d changed", info->params[i].id);
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	emit_node_info(this, false);
 | 
						emit_node_info(this, false);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue