mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	adapter:handle -ENOENT when enumerating buffers
When the follower has no buffer suggestion, it can return -ENOENT, which should not generate an error but simply use the converter buffer suggestion instead.
This commit is contained in:
		
							parent
							
								
									eda42ef2fc
								
							
						
					
					
						commit
						62a719d71a
					
				
					 2 changed files with 20 additions and 12 deletions
				
			
		| 
						 | 
				
			
			@ -449,8 +449,9 @@ static int negotiate_buffers(struct impl *this)
 | 
			
		|||
		if (res == -ENOENT)
 | 
			
		||||
			param = NULL;
 | 
			
		||||
		else {
 | 
			
		||||
			debug_params(this, this->follower, this->direction, 0,
 | 
			
		||||
				SPA_PARAM_Buffers, param, "follower buffers", res);
 | 
			
		||||
			debug_params(this, this->target,
 | 
			
		||||
				SPA_DIRECTION_REVERSE(this->direction), 0,
 | 
			
		||||
				SPA_PARAM_Buffers, param, "target buffers", res);
 | 
			
		||||
			return res;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			@ -460,10 +461,13 @@ static int negotiate_buffers(struct impl *this)
 | 
			
		|||
				this->direction, 0,
 | 
			
		||||
				SPA_PARAM_Buffers, &state,
 | 
			
		||||
				param, ¶m, &b)) != 1) {
 | 
			
		||||
		debug_params(this, this->target,
 | 
			
		||||
				SPA_DIRECTION_REVERSE(this->direction), 0,
 | 
			
		||||
				SPA_PARAM_Buffers, param, "convert buffers", res);
 | 
			
		||||
		return -ENOTSUP;
 | 
			
		||||
		if (res == -ENOENT)
 | 
			
		||||
			res = 0;
 | 
			
		||||
		else {
 | 
			
		||||
			debug_params(this, this->follower, this->direction, 0,
 | 
			
		||||
				SPA_PARAM_Buffers, param, "follower buffers", res);
 | 
			
		||||
			return res < 0 ? res : -ENOTSUP;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	if (param == NULL)
 | 
			
		||||
		return -ENOTSUP;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -423,8 +423,9 @@ static int negotiate_buffers(struct impl *this)
 | 
			
		|||
		if (res == -ENOENT)
 | 
			
		||||
			param = NULL;
 | 
			
		||||
		else {
 | 
			
		||||
			debug_params(this, this->follower, this->direction, 0,
 | 
			
		||||
				SPA_PARAM_Buffers, param, "follower buffers", res);
 | 
			
		||||
			debug_params(this, this->target,
 | 
			
		||||
				SPA_DIRECTION_REVERSE(this->direction), 0,
 | 
			
		||||
				SPA_PARAM_Buffers, param, "target buffers", res);
 | 
			
		||||
			return res;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			@ -434,10 +435,13 @@ static int negotiate_buffers(struct impl *this)
 | 
			
		|||
				this->direction, 0,
 | 
			
		||||
				SPA_PARAM_Buffers, &state,
 | 
			
		||||
				param, ¶m, &b)) != 1) {
 | 
			
		||||
		debug_params(this, this->target,
 | 
			
		||||
				SPA_DIRECTION_REVERSE(this->direction), 0,
 | 
			
		||||
				SPA_PARAM_Buffers, param, "convert buffers", res);
 | 
			
		||||
		return -ENOTSUP;
 | 
			
		||||
		if (res == -ENOENT)
 | 
			
		||||
			res = 0;
 | 
			
		||||
		else {
 | 
			
		||||
			debug_params(this, this->follower, this->direction, 0,
 | 
			
		||||
				SPA_PARAM_Buffers, param, "follower buffers", res);
 | 
			
		||||
			return res < 0 ? res : -ENOTSUP;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	if (param == NULL)
 | 
			
		||||
		return -ENOTSUP;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue