mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	bluetooth: reinitialize the sample spec when switching profile
When doing init_profile(), the value u->sample_spec is modified to the one which has been last configured. In case of HSP, it will be 8kHz. Later on, when setting the profile to A2DP, it picks up the lower rate available which match with current u->sample_spec. In my case, it would be 16kHz. To circunvent the issue, I decided to reinitialize the u->sample_spec to default value with user module argument requested rate.
This commit is contained in:
		
							parent
							
								
									cac0f9ef2b
								
							
						
					
					
						commit
						cce4359831
					
				
					 1 changed files with 8 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -1568,6 +1568,14 @@ static int card_set_profile(pa_card *c, pa_card_profile *new_profile) {
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    u->profile = *d;
 | 
			
		||||
 | 
			
		||||
    /* Reinitialize the sample spec to default with module argument rate */
 | 
			
		||||
    u->sample_spec = u->module->core->default_sample_spec;
 | 
			
		||||
    if (pa_modargs_get_value_u32(u->modargs, "rate", &u->sample_spec.rate) < 0 ||
 | 
			
		||||
        u->sample_spec.rate <= 0 || u->sample_spec.rate > PA_RATE_MAX) {
 | 
			
		||||
        u->sample_spec = u->module->core->default_sample_spec;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    init_profile(u);
 | 
			
		||||
 | 
			
		||||
    if (u->sink || u->source)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue