mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	audioconvert: also set io_position on channelmix
Also make the channelmix node aware of the io_position so that is can use this later to get the default rate.
This commit is contained in:
		
							parent
							
								
									c726dd887c
								
							
						
					
					
						commit
						ed80d72d51
					
				
					 2 changed files with 17 additions and 1 deletions
				
			
		| 
						 | 
					@ -557,6 +557,7 @@ static int impl_node_set_io(void *object, uint32_t id, void *data, size_t size)
 | 
				
			||||||
	switch (id) {
 | 
						switch (id) {
 | 
				
			||||||
	case SPA_IO_Position:
 | 
						case SPA_IO_Position:
 | 
				
			||||||
		res = spa_node_set_io(this->resample, id, data, size);
 | 
							res = spa_node_set_io(this->resample, id, data, size);
 | 
				
			||||||
 | 
							res = spa_node_set_io(this->channelmix, id, data, size);
 | 
				
			||||||
		res = spa_node_set_io(this->fmt[0], id, data, size);
 | 
							res = spa_node_set_io(this->fmt[0], id, data, size);
 | 
				
			||||||
		res = spa_node_set_io(this->fmt[1], id, data, size);
 | 
							res = spa_node_set_io(this->fmt[1], id, data, size);
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -144,6 +144,8 @@ struct impl {
 | 
				
			||||||
	struct spa_log *log;
 | 
						struct spa_log *log;
 | 
				
			||||||
	struct spa_cpu *cpu;
 | 
						struct spa_cpu *cpu;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						struct spa_io_position *io_position;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct spa_hook_list hooks;
 | 
						struct spa_hook_list hooks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	uint64_t info_all;
 | 
						uint64_t info_all;
 | 
				
			||||||
| 
						 | 
					@ -595,7 +597,20 @@ static int apply_midi(struct impl *this, const struct spa_pod *value)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int impl_node_set_io(void *object, uint32_t id, void *data, size_t size)
 | 
					static int impl_node_set_io(void *object, uint32_t id, void *data, size_t size)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	return -ENOTSUP;
 | 
						struct impl *this = object;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						spa_return_val_if_fail(this != NULL, -EINVAL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						spa_log_debug(this->log, NAME " %p: io %d %p/%zd", this, id, data, size);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						switch (id) {
 | 
				
			||||||
 | 
						case SPA_IO_Position:
 | 
				
			||||||
 | 
							this->io_position = data;
 | 
				
			||||||
 | 
							break;
 | 
				
			||||||
 | 
						default:
 | 
				
			||||||
 | 
							return -ENOENT;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int impl_node_set_param(void *object, uint32_t id, uint32_t flags,
 | 
					static int impl_node_set_param(void *object, uint32_t id, uint32_t flags,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue