mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	bluetooth: Do not check profile states is device_audio_is_ready()
The function is used to make sure some basic information has already been gathered before the device is being used. At this point profile states can be ignored, since their initial value will be PA_BT_AUDIO_STATE_INVALID and thus effectively similar to PA_BT_AUDIO_STATE_DISCONNECTED due to audio_state_to_transport_state(). The change should make no difference given that the behavior of pa_bluetooth_device_any_audio_connected() doesn't change: by the time TRUE is returned, a transport needs to exist. This means a profile will exist in CONNECTING or CONNECTED state and thus the old implementation of device_audio_is_ready() would also have returned TRUE.
This commit is contained in:
		
							parent
							
								
									93e19c884b
								
							
						
					
					
						commit
						8eb3d14b13
					
				
					 1 changed files with 1 additions and 7 deletions
				
			
		| 
						 | 
					@ -235,18 +235,12 @@ static void device_free(pa_bluetooth_device *d) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static pa_bool_t device_is_audio_ready(const pa_bluetooth_device *d) {
 | 
					static pa_bool_t device_is_audio_ready(const pa_bluetooth_device *d) {
 | 
				
			||||||
    unsigned i;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    pa_assert(d);
 | 
					    pa_assert(d);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!d->device_info_valid || d->audio_state == PA_BT_AUDIO_STATE_INVALID)
 | 
					    if (!d->device_info_valid || d->audio_state == PA_BT_AUDIO_STATE_INVALID)
 | 
				
			||||||
        return false;
 | 
					        return false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (i = 0; i < PA_BLUETOOTH_PROFILE_COUNT; i++)
 | 
					    return true;
 | 
				
			||||||
        if (d->profile_state[i] != PA_BT_AUDIO_STATE_INVALID)
 | 
					 | 
				
			||||||
            return true;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return false;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static const char *check_variant_property(DBusMessageIter *i) {
 | 
					static const char *check_variant_property(DBusMessageIter *i) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue