mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	bluetooth: Trivially refactor to call setup_stream() directly
If the transport is already acquired and the stream needs to be started, call setup_stream() directly instead of bt_transport_acquire(u, TRUE). Both calls are identical in these conditions, with the exception of the log trace which has now been moved to setup_stream().
This commit is contained in:
		
							parent
							
								
									6ef23eb4af
								
							
						
					
					
						commit
						1dcdb96ee5
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -284,6 +284,8 @@ static void setup_stream(struct userdata *u) {
 | 
			
		|||
    struct pollfd *pollfd;
 | 
			
		||||
    int one;
 | 
			
		||||
 | 
			
		||||
    pa_log_info("Transport %s resuming", u->transport->path);
 | 
			
		||||
 | 
			
		||||
    bt_transport_config_mtu(u);
 | 
			
		||||
 | 
			
		||||
    pa_make_fd_nonblock(u->stream_fd);
 | 
			
		||||
| 
						 | 
				
			
			@ -424,7 +426,6 @@ static int bt_transport_acquire(struct userdata *u, pa_bool_t start) {
 | 
			
		|||
        return 0;
 | 
			
		||||
 | 
			
		||||
done:
 | 
			
		||||
    pa_log_info("Transport %s resuming", u->transport->path);
 | 
			
		||||
    setup_stream(u);
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -1045,7 +1046,7 @@ static void thread_func(void *userdata) {
 | 
			
		|||
 | 
			
		||||
    /* Setup the stream only if the transport was already acquired */
 | 
			
		||||
    if (bt_transport_is_acquired(u))
 | 
			
		||||
        bt_transport_acquire(u, TRUE);
 | 
			
		||||
        setup_stream(u);
 | 
			
		||||
 | 
			
		||||
    for (;;) {
 | 
			
		||||
        struct pollfd *pollfd;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue