mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	alsa sink/source: fix the mixer initialization
- remove duplicate mixer initialization in sink - use the similar mixer initialization for source like for sink Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
		
							parent
							
								
									fc5f263e59
								
							
						
					
					
						commit
						5eb02e31a6
					
				
					 2 changed files with 7 additions and 7 deletions
				
			
		| 
						 | 
					@ -2511,8 +2511,6 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
 | 
				
			||||||
    /* ALSA might tweak the sample spec, so recalculate the frame size */
 | 
					    /* ALSA might tweak the sample spec, so recalculate the frame size */
 | 
				
			||||||
    frame_size = pa_frame_size(&ss);
 | 
					    frame_size = pa_frame_size(&ss);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    find_mixer(u, mapping, pa_modargs_get_value(ma, "control", NULL), ignore_dB);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    pa_sink_new_data_init(&data);
 | 
					    pa_sink_new_data_init(&data);
 | 
				
			||||||
    data.driver = driver;
 | 
					    data.driver = driver;
 | 
				
			||||||
    data.module = m;
 | 
					    data.module = m;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2198,8 +2198,6 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
 | 
				
			||||||
    /* ALSA might tweak the sample spec, so recalculate the frame size */
 | 
					    /* ALSA might tweak the sample spec, so recalculate the frame size */
 | 
				
			||||||
    frame_size = pa_frame_size(&ss);
 | 
					    frame_size = pa_frame_size(&ss);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    find_mixer(u, mapping, pa_modargs_get_value(ma, "control", NULL), ignore_dB);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    pa_source_new_data_init(&data);
 | 
					    pa_source_new_data_init(&data);
 | 
				
			||||||
    data.driver = driver;
 | 
					    data.driver = driver;
 | 
				
			||||||
    data.module = m;
 | 
					    data.module = m;
 | 
				
			||||||
| 
						 | 
					@ -2254,10 +2252,14 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
 | 
				
			||||||
        goto fail;
 | 
					        goto fail;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (u->ucm_context)
 | 
					    if (u->ucm_context) {
 | 
				
			||||||
        pa_alsa_ucm_add_ports(&data.ports, data.proplist, u->ucm_context, false, card, u->pcm_handle, ignore_dB);
 | 
					        pa_alsa_ucm_add_ports(&data.ports, data.proplist, u->ucm_context, false, card, u->pcm_handle, ignore_dB);
 | 
				
			||||||
    else if (u->mixer_path_set)
 | 
					        find_mixer(u, mapping, pa_modargs_get_value(ma, "control", NULL), ignore_dB);
 | 
				
			||||||
        pa_alsa_add_ports(&data, u->mixer_path_set, card);
 | 
					    } else {
 | 
				
			||||||
 | 
					        find_mixer(u, mapping, pa_modargs_get_value(ma, "control", NULL), ignore_dB);
 | 
				
			||||||
 | 
					        if (u->mixer_path_set)
 | 
				
			||||||
 | 
					            pa_alsa_add_ports(&data, u->mixer_path_set, card);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    u->source = pa_source_new(m->core, &data, PA_SOURCE_HARDWARE|PA_SOURCE_LATENCY|(u->use_tsched ? PA_SOURCE_DYNAMIC_LATENCY : 0));
 | 
					    u->source = pa_source_new(m->core, &data, PA_SOURCE_HARDWARE|PA_SOURCE_LATENCY|(u->use_tsched ? PA_SOURCE_DYNAMIC_LATENCY : 0));
 | 
				
			||||||
    volume_is_set = data.volume_is_set;
 | 
					    volume_is_set = data.volume_is_set;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue