mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	client-node: only return -ENOENT for unknown param
Always iterate all params because we are only supposed to return -ENOENT for unknown params and if we start iterating at some random start position we might be past the paran and report -ENOENT wrongly.
This commit is contained in:
		
							parent
							
								
									847ee8f064
								
							
						
					
					
						commit
						0ed86941ce
					
				
					 1 changed files with 10 additions and 2 deletions
				
			
		| 
						 | 
					@ -286,7 +286,7 @@ static int impl_node_enum_params(void *object, int seq,
 | 
				
			||||||
	spa_return_val_if_fail(num != 0, -EINVAL);
 | 
						spa_return_val_if_fail(num != 0, -EINVAL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	result.id = id;
 | 
						result.id = id;
 | 
				
			||||||
	result.next = start;
 | 
						result.next = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	while (true) {
 | 
						while (true) {
 | 
				
			||||||
		struct spa_pod *param;
 | 
							struct spa_pod *param;
 | 
				
			||||||
| 
						 | 
					@ -301,6 +301,10 @@ static int impl_node_enum_params(void *object, int seq,
 | 
				
			||||||
			continue;
 | 
								continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		found = true;
 | 
							found = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if (result.index < start)
 | 
				
			||||||
 | 
								continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		spa_pod_builder_init(&b, buffer, sizeof(buffer));
 | 
							spa_pod_builder_init(&b, buffer, sizeof(buffer));
 | 
				
			||||||
		if (spa_pod_filter(&b, &result.param, param, filter) != 0)
 | 
							if (spa_pod_filter(&b, &result.param, param, filter) != 0)
 | 
				
			||||||
			continue;
 | 
								continue;
 | 
				
			||||||
| 
						 | 
					@ -572,7 +576,7 @@ impl_node_port_enum_params(void *object, int seq,
 | 
				
			||||||
			this, seq, direction, port_id, id, start, num, port->n_params);
 | 
								this, seq, direction, port_id, id, start, num, port->n_params);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	result.id = id;
 | 
						result.id = id;
 | 
				
			||||||
	result.next = start;
 | 
						result.next = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	while (true) {
 | 
						while (true) {
 | 
				
			||||||
		struct spa_pod *param;
 | 
							struct spa_pod *param;
 | 
				
			||||||
| 
						 | 
					@ -587,6 +591,10 @@ impl_node_port_enum_params(void *object, int seq,
 | 
				
			||||||
			continue;
 | 
								continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		found = true;
 | 
							found = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if (result.index < start)
 | 
				
			||||||
 | 
								continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		spa_pod_builder_init(&b, buffer, sizeof(buffer));
 | 
							spa_pod_builder_init(&b, buffer, sizeof(buffer));
 | 
				
			||||||
		if (spa_pod_filter(&b, &result.param, param, filter) < 0)
 | 
							if (spa_pod_filter(&b, &result.param, param, filter) < 0)
 | 
				
			||||||
			continue;
 | 
								continue;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue