mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	bluez5: remove device on disconnect
Do device_remove when device disconnects. This can occur, as profile check is not run on HFP/HSP profile disconnect.
This commit is contained in:
		
							parent
							
								
									6b11bf71f3
								
							
						
					
					
						commit
						b6108df6f3
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		| 
						 | 
					@ -612,6 +612,8 @@ int spa_bt_device_check_profiles(struct spa_bt_device *device, bool force)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void device_set_connected(struct spa_bt_device *device, int connected)
 | 
					static void device_set_connected(struct spa_bt_device *device, int connected)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						struct spa_bt_monitor *monitor = device->monitor;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (device->connected && !connected)
 | 
						if (device->connected && !connected)
 | 
				
			||||||
		device->connected_profiles = 0;
 | 
							device->connected_profiles = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -619,8 +621,11 @@ static void device_set_connected(struct spa_bt_device *device, int connected)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (connected)
 | 
						if (connected)
 | 
				
			||||||
		spa_bt_device_check_profiles(device, false);
 | 
							spa_bt_device_check_profiles(device, false);
 | 
				
			||||||
	else
 | 
						else {
 | 
				
			||||||
		device_stop_timer(device);
 | 
							device_stop_timer(device);
 | 
				
			||||||
 | 
							if (device->added)
 | 
				
			||||||
 | 
								device_remove(monitor, device);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int spa_bt_device_connect_profile(struct spa_bt_device *device, enum spa_bt_profile profile)
 | 
					int spa_bt_device_connect_profile(struct spa_bt_device *device, enum spa_bt_profile profile)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue