mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	node: improve pending results
Make a special function for pending results to make it clear that it is different from normal results. Don't pass result code to result function, it is not useful because since the callback is called, all must be fine. The spa_pending is removed from the list right before the callback and can thus be freed in the callback. Pass the spa_pending in the pending callback so that extra data can be added that way. Reuse spa_pending objects in link and nodes instead of allocating. We always only have one pending operation and we can cancel any pending previous operation by removing the pending.
This commit is contained in:
		
							parent
							
								
									a3ca2df0fe
								
							
						
					
					
						commit
						98463b689b
					
				
					 33 changed files with 126 additions and 156 deletions
				
			
		| 
						 | 
				
			
			@ -170,7 +170,7 @@ static int impl_node_enum_params(struct spa_node *node,
 | 
			
		|||
	if (spa_pod_filter(&b, &result.param, param, filter) < 0)
 | 
			
		||||
		goto next;
 | 
			
		||||
 | 
			
		||||
	if ((res = func(data, count, 1, &result)) != 0)
 | 
			
		||||
	if ((res = func(data, count, &result)) != 0)
 | 
			
		||||
		return res;
 | 
			
		||||
 | 
			
		||||
	if (++count != num)
 | 
			
		||||
| 
						 | 
				
			
			@ -350,7 +350,7 @@ impl_node_sync(struct spa_node *node)
 | 
			
		|||
 | 
			
		||||
static int
 | 
			
		||||
impl_node_wait(struct spa_node *node, int seq, struct spa_pending *pending,
 | 
			
		||||
		spa_result_func_t func, void *data)
 | 
			
		||||
		spa_pending_func_t func, void *data)
 | 
			
		||||
{
 | 
			
		||||
	struct node *this;
 | 
			
		||||
	struct impl *impl;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue