mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	context: don't follow links to inactive nodes
We don't need to follow nodes that we already visited or that are inactive so skip them early. Always try to prepare the link otherwise, not only for passive links because non-passive links might also be paused because of a suspended driver.
This commit is contained in:
		
							parent
							
								
									7092effaab
								
							
						
					
					
						commit
						ebf4bf8d83
					
				
					 1 changed files with 10 additions and 10 deletions
				
			
		| 
						 | 
					@ -944,13 +944,14 @@ static int collect_nodes(struct pw_context *context, struct pw_impl_node *driver
 | 
				
			||||||
			spa_list_for_each(l, &p->links, input_link) {
 | 
								spa_list_for_each(l, &p->links, input_link) {
 | 
				
			||||||
				t = l->output->node;
 | 
									t = l->output->node;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				if (l->passive)
 | 
					 | 
				
			||||||
					pw_impl_link_prepare(l);
 | 
					 | 
				
			||||||
				else if (t->active)
 | 
					 | 
				
			||||||
					driver->passive = n->passive = false;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
				if (t->visited || !t->active)
 | 
									if (t->visited || !t->active)
 | 
				
			||||||
					continue;
 | 
										continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									pw_impl_link_prepare(l);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									if (!l->passive)
 | 
				
			||||||
 | 
										driver->passive = n->passive = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				if (l->prepared) {
 | 
									if (l->prepared) {
 | 
				
			||||||
					t->visited = true;
 | 
										t->visited = true;
 | 
				
			||||||
					spa_list_append(&queue, &t->sort_link);
 | 
										spa_list_append(&queue, &t->sort_link);
 | 
				
			||||||
| 
						 | 
					@ -961,13 +962,12 @@ static int collect_nodes(struct pw_context *context, struct pw_impl_node *driver
 | 
				
			||||||
			spa_list_for_each(l, &p->links, output_link) {
 | 
								spa_list_for_each(l, &p->links, output_link) {
 | 
				
			||||||
				t = l->input->node;
 | 
									t = l->input->node;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				if (l->passive)
 | 
					 | 
				
			||||||
					pw_impl_link_prepare(l);
 | 
					 | 
				
			||||||
				else if (t->active)
 | 
					 | 
				
			||||||
					driver->passive = n->passive = false;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
				if (t->visited || !t->active)
 | 
									if (t->visited || !t->active)
 | 
				
			||||||
					continue;
 | 
										continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									if (!l->passive)
 | 
				
			||||||
 | 
										driver->passive = n->passive = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				if (l->prepared) {
 | 
									if (l->prepared) {
 | 
				
			||||||
					t->visited = true;
 | 
										t->visited = true;
 | 
				
			||||||
					spa_list_append(&queue, &t->sort_link);
 | 
										spa_list_append(&queue, &t->sort_link);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue