mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	port: remove some checks, the mixer is always set
This commit is contained in:
		
							parent
							
								
									1ca399d4a6
								
							
						
					
					
						commit
						909abdb6bf
					
				
					 1 changed files with 5 additions and 6 deletions
				
			
		| 
						 | 
					@ -152,7 +152,7 @@ int pw_port_init_mix(struct pw_port *port, struct pw_port_mix *mix)
 | 
				
			||||||
	mix->p = port;
 | 
						mix->p = port;
 | 
				
			||||||
	mix->state = PW_PORT_STATE_CONFIGURE;
 | 
						mix->state = PW_PORT_STATE_CONFIGURE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (port->mix && port->mix->add_port)
 | 
						if (port->mix->add_port)
 | 
				
			||||||
		port->mix->add_port(port->mix, port->direction, port_id);
 | 
							port->mix->add_port(port->mix, port->direction, port_id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (pi && pi->init_mix)
 | 
						if (pi && pi->init_mix)
 | 
				
			||||||
| 
						 | 
					@ -174,7 +174,7 @@ int pw_port_release_mix(struct pw_port *port, struct pw_port_mix *mix)
 | 
				
			||||||
	if (pi && pi->release_mix)
 | 
						if (pi && pi->release_mix)
 | 
				
			||||||
		res = pi->release_mix(port->implementation_data, mix);
 | 
							res = pi->release_mix(port->implementation_data, mix);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (port->mix && port->mix->remove_port) {
 | 
						if (port->mix->remove_port) {
 | 
				
			||||||
		port->mix->remove_port(port->mix, port->direction, port_id);
 | 
							port->mix->remove_port(port->mix, port->direction, port_id);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -784,7 +784,7 @@ int pw_port_set_param(struct pw_port *port, uint32_t mix_id, uint32_t id, uint32
 | 
				
			||||||
	if (mix_id != SPA_ID_INVALID)
 | 
						if (mix_id != SPA_ID_INVALID)
 | 
				
			||||||
		mix = pw_map_lookup(&port->mix_port_map, mix_id);
 | 
							mix = pw_map_lookup(&port->mix_port_map, mix_id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (mix != NULL && port->mix != NULL && port->mix->port_set_param != NULL) {
 | 
						if (mix != NULL && port->mix->port_set_param != NULL) {
 | 
				
			||||||
		struct spa_graph_port *p = &mix->port;
 | 
							struct spa_graph_port *p = &mix->port;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		res = spa_node_port_set_param(port->mix,
 | 
							res = spa_node_port_set_param(port->mix,
 | 
				
			||||||
| 
						 | 
					@ -808,7 +808,6 @@ int pw_port_set_param(struct pw_port *port, uint32_t mix_id, uint32_t id, uint32
 | 
				
			||||||
				spa_debug_type_find_name(spa_type_param, id), res, spa_strerror(res));
 | 
									spa_debug_type_find_name(spa_type_param, id), res, spa_strerror(res));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (id == SPA_PARAM_Format) {
 | 
						if (id == SPA_PARAM_Format) {
 | 
				
			||||||
		if (param == NULL || res < 0) {
 | 
							if (param == NULL || res < 0) {
 | 
				
			||||||
			free_allocation(&port->allocation);
 | 
								free_allocation(&port->allocation);
 | 
				
			||||||
| 
						 | 
					@ -845,7 +844,7 @@ int pw_port_use_buffers(struct pw_port *port, uint32_t mix_id,
 | 
				
			||||||
	if ((mix = pw_map_lookup(&port->mix_port_map, mix_id)) == NULL)
 | 
						if ((mix = pw_map_lookup(&port->mix_port_map, mix_id)) == NULL)
 | 
				
			||||||
		return -EIO;
 | 
							return -EIO;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (port->mix != NULL && port->mix->port_use_buffers != NULL) {
 | 
						if (port->mix->port_use_buffers != NULL) {
 | 
				
			||||||
		struct spa_graph_port *p = &mix->port;
 | 
							struct spa_graph_port *p = &mix->port;
 | 
				
			||||||
		res = spa_node_port_use_buffers(port->mix,
 | 
							res = spa_node_port_use_buffers(port->mix,
 | 
				
			||||||
					p->direction, p->port_id, buffers, n_buffers);
 | 
										p->direction, p->port_id, buffers, n_buffers);
 | 
				
			||||||
| 
						 | 
					@ -895,7 +894,7 @@ int pw_port_alloc_buffers(struct pw_port *port, uint32_t mix_id,
 | 
				
			||||||
	if ((mix = pw_map_lookup(&port->mix_port_map, mix_id)) == NULL)
 | 
						if ((mix = pw_map_lookup(&port->mix_port_map, mix_id)) == NULL)
 | 
				
			||||||
		return -EIO;
 | 
							return -EIO;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (port->mix && port->mix->port_use_buffers) {
 | 
						if (port->mix->port_use_buffers) {
 | 
				
			||||||
		struct spa_graph_port *p = &mix->port;
 | 
							struct spa_graph_port *p = &mix->port;
 | 
				
			||||||
		res = spa_node_port_alloc_buffers(port->mix, p->direction, p->port_id,
 | 
							res = spa_node_port_alloc_buffers(port->mix, p->direction, p->port_id,
 | 
				
			||||||
						  params, n_params,
 | 
											  params, n_params,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue