mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	bluetooth: don't connect on unconnected profile
This commit is contained in:
		
							parent
							
								
									e93c6c36fe
								
							
						
					
					
						commit
						95d3faaac8
					
				
					 1 changed files with 9 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -2085,6 +2085,15 @@ static int add_card(struct userdata *u, const pa_bluetooth_device *device) {
 | 
			
		|||
    u->card->userdata = u;
 | 
			
		||||
    u->card->set_profile = card_set_profile;
 | 
			
		||||
 | 
			
		||||
    d = PA_CARD_PROFILE_DATA(u->card->active_profile);
 | 
			
		||||
 | 
			
		||||
    if ((device->headset_state < PA_BT_AUDIO_STATE_CONNECTED && *d == PROFILE_HSP) ||
 | 
			
		||||
        (device->audio_sink_state < PA_BT_AUDIO_STATE_CONNECTED && *d == PROFILE_A2DP)) {
 | 
			
		||||
        pa_log_warn("Default profile not connected, selecting off profile");
 | 
			
		||||
        u->card->active_profile = pa_hashmap_get(u->card->profiles, "off");
 | 
			
		||||
        u->card->save_profile = FALSE;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    d = PA_CARD_PROFILE_DATA(u->card->active_profile);
 | 
			
		||||
    u->profile = *d;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue