mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-10-29 05:40:27 -04:00 
			
		
		
		
	bluez5: clean up node volume emitting
The problem described in previous 'volume_changed()' has been fixed
in 5bf2144438, hence we don't need
that workaround anymore.
			
			
This commit is contained in:
		
							parent
							
								
									d2d0375c39
								
							
						
					
					
						commit
						27433c4000
					
				
					 1 changed files with 5 additions and 8 deletions
				
			
		|  | @ -313,14 +313,11 @@ static void volume_changed(void *userdata) | |||
| 
 | ||||
| 	node_update_soft_volumes(node, t_volume->volume); | ||||
| 
 | ||||
| 	emit_volume(impl, node); | ||||
| 
 | ||||
| 	impl->info.change_mask |= SPA_DEVICE_CHANGE_MASK_PARAMS; | ||||
| 	impl->params[IDX_Route].flags ^= SPA_PARAM_INFO_SERIAL; | ||||
| 	emit_info(impl, false); | ||||
| 
 | ||||
| 	/* It sometimes flips volume to over 100% in pavucontrol slider
 | ||||
| 	 * if volume is emitted before route info emitting while node | ||||
| 	 * volumes are not identical to route volumes. Not sure why. */ | ||||
| 	emit_volume(impl, node); | ||||
| } | ||||
| 
 | ||||
| static const struct spa_bt_transport_events transport_events = { | ||||
|  | @ -1535,7 +1532,7 @@ static int node_set_volume(struct impl *this, struct node *node, float volumes[] | |||
| 	if (n_volumes == 0) | ||||
| 		return -EINVAL; | ||||
| 
 | ||||
| 	spa_log_debug(this->log, "node %p volume %f", node, volumes[0]); | ||||
| 	spa_log_info(this->log, "node %p volume %f", node, volumes[0]); | ||||
| 
 | ||||
| 	for (i = 0; i < node->n_channels; i++) { | ||||
| 		if (node->volumes[i] == volumes[i % n_volumes]) | ||||
|  | @ -1558,6 +1555,8 @@ static int node_set_volume(struct impl *this, struct node *node, float volumes[] | |||
| 			node->soft_volumes[i] = node->volumes[i]; | ||||
| 	} | ||||
| 
 | ||||
| 	emit_volume(this, node); | ||||
| 
 | ||||
| 	return changed; | ||||
| } | ||||
| 
 | ||||
|  | @ -1744,8 +1743,6 @@ static int impl_set_param(void *object, | |||
| 				this->params[IDX_Route].flags ^= SPA_PARAM_INFO_SERIAL; | ||||
| 			} | ||||
| 			emit_info(this, false); | ||||
| 			/* See volume_changed(void *) */ | ||||
| 			emit_volume(this, node); | ||||
| 		} | ||||
| 		break; | ||||
| 	} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Huang-Huang Bao
						Huang-Huang Bao