mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	* alsa-sink: if "PCM" is not found as mixer track name, fallback to "Master"
* alsa-source: if "Capture" is not found as mixer track name, fallback to "Mic" git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@993 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
		
							parent
							
								
									bb820db4b5
								
							
						
					
					
						commit
						64fa5b882f
					
				
					 4 changed files with 20 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -337,18 +337,29 @@ int pa_alsa_prepare_mixer(snd_mixer_t *mixer, const char *dev) {
 | 
			
		|||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
snd_mixer_elem_t *pa_alsa_find_elem(snd_mixer_t *mixer, const char *name) {
 | 
			
		||||
snd_mixer_elem_t *pa_alsa_find_elem(snd_mixer_t *mixer, const char *name, const char *fallback) {
 | 
			
		||||
    snd_mixer_elem_t *elem;
 | 
			
		||||
    snd_mixer_selem_id_t *sid;
 | 
			
		||||
    snd_mixer_selem_id_t *sid = NULL;
 | 
			
		||||
    snd_mixer_selem_id_alloca(&sid);
 | 
			
		||||
 | 
			
		||||
    assert(mixer && name);
 | 
			
		||||
    assert(mixer);
 | 
			
		||||
    assert(name);
 | 
			
		||||
 | 
			
		||||
    snd_mixer_selem_id_set_name(sid, name);
 | 
			
		||||
 | 
			
		||||
    elem = snd_mixer_find_selem(mixer, sid);
 | 
			
		||||
    if (!elem)
 | 
			
		||||
        pa_log_warn(__FILE__": Cannot find mixer control %s", snd_mixer_selem_id_get_name(sid));
 | 
			
		||||
    if (!(elem = snd_mixer_find_selem(mixer, sid))) {
 | 
			
		||||
        pa_log_warn(__FILE__": Cannot find mixer control \"%s\".", snd_mixer_selem_id_get_name(sid));
 | 
			
		||||
 | 
			
		||||
        if (fallback) {
 | 
			
		||||
            snd_mixer_selem_id_set_name(sid, fallback);
 | 
			
		||||
            
 | 
			
		||||
            if (!(elem = snd_mixer_find_selem(mixer, sid)))
 | 
			
		||||
                pa_log_warn(__FILE__": Cannot find fallback mixer control \"%s\".", snd_mixer_selem_id_get_name(sid));
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (elem)
 | 
			
		||||
        pa_log_warn(__FILE__": Using mixer control \"%s\".", snd_mixer_selem_id_get_name(sid));
 | 
			
		||||
 | 
			
		||||
    return elem;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue