mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	sink/source: When picking the initial ports, prefer ones that are not unavailable.
This does for sinks/source ports what f434087e42 did for card profiles.
			
			
This commit is contained in:
		
							parent
							
								
									84af39f289
								
							
						
					
					
						commit
						303cff04eb
					
				
					 2 changed files with 21 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -292,9 +292,19 @@ pa_source* pa_source_new(
 | 
			
		|||
        void *state;
 | 
			
		||||
        pa_device_port *p;
 | 
			
		||||
 | 
			
		||||
        PA_HASHMAP_FOREACH(p, s->ports, state)
 | 
			
		||||
        PA_HASHMAP_FOREACH(p, s->ports, state) {
 | 
			
		||||
            if (p->available == PA_AVAILABLE_NO)
 | 
			
		||||
                continue;
 | 
			
		||||
 | 
			
		||||
            if (!s->active_port || p->priority > s->active_port->priority)
 | 
			
		||||
                s->active_port = p;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (!s->active_port) {
 | 
			
		||||
            PA_HASHMAP_FOREACH(p, s->ports, state)
 | 
			
		||||
                if (!s->active_port || p->priority > s->active_port->priority)
 | 
			
		||||
                    s->active_port = p;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (s->active_port)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue