mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	audioadapter: recheck formats when EnumFormat changes
When the follower has new EnumFormat, make sure we recheck the formats the next time the node is started.
This commit is contained in:
		
							parent
							
								
									29595ca7bf
								
							
						
					
					
						commit
						bc435dc6f3
					
				
					 1 changed files with 7 additions and 2 deletions
				
			
		| 
						 | 
					@ -88,6 +88,7 @@ struct impl {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	unsigned int add_listener:1;
 | 
						unsigned int add_listener:1;
 | 
				
			||||||
	unsigned int have_format:1;
 | 
						unsigned int have_format:1;
 | 
				
			||||||
 | 
						unsigned int recheck_format:1;
 | 
				
			||||||
	unsigned int started:1;
 | 
						unsigned int started:1;
 | 
				
			||||||
	unsigned int ready:1;
 | 
						unsigned int ready:1;
 | 
				
			||||||
	unsigned int async:1;
 | 
						unsigned int async:1;
 | 
				
			||||||
| 
						 | 
					@ -853,11 +854,14 @@ static int negotiate_format(struct impl *this)
 | 
				
			||||||
	struct spa_pod_builder b = { 0 };
 | 
						struct spa_pod_builder b = { 0 };
 | 
				
			||||||
	int res;
 | 
						int res;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	spa_log_debug(this->log, "%p: have_format:%d", this, this->have_format);
 | 
						spa_log_debug(this->log, "%p: have_format:%d recheck:%d", this, this->have_format,
 | 
				
			||||||
 | 
								this->recheck_format);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (this->have_format)
 | 
						if (this->have_format && !this->recheck_format)
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						this->recheck_format = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	spa_pod_builder_init(&b, buffer, sizeof(buffer));
 | 
						spa_pod_builder_init(&b, buffer, sizeof(buffer));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	spa_node_send_command(this->follower,
 | 
						spa_node_send_command(this->follower,
 | 
				
			||||||
| 
						 | 
					@ -1292,6 +1296,7 @@ static void follower_port_info(void *data,
 | 
				
			||||||
			if (idx == IDX_EnumFormat) {
 | 
								if (idx == IDX_EnumFormat) {
 | 
				
			||||||
				spa_log_debug(this->log, "new formats");
 | 
									spa_log_debug(this->log, "new formats");
 | 
				
			||||||
				/* we will renegotiate when restarting */
 | 
									/* we will renegotiate when restarting */
 | 
				
			||||||
 | 
									this->recheck_format = true;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			this->params[idx].user++;
 | 
								this->params[idx].user++;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue