mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	filter-heuristics: Don't force AEC on all phone streams
Removing the bit that automatically loads module-echo-cancel for phone streams. Clients need to specifically opt in for this now with filter.want, until we are reasonably certain this won't break other apps (Skype for one, possibly others).
This commit is contained in:
		
							parent
							
								
									2e075bb837
								
							
						
					
					
						commit
						2c852061ee
					
				
					 1 changed files with 3 additions and 8 deletions
				
			
		| 
						 | 
					@ -77,7 +77,7 @@ static pa_bool_t role_match(pa_proplist *proplist, const char *role) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static pa_hook_result_t process(struct userdata *u, pa_object *o, pa_bool_t is_sink_input) {
 | 
					static pa_hook_result_t process(struct userdata *u, pa_object *o, pa_bool_t is_sink_input) {
 | 
				
			||||||
    const char *want, *stream_role;
 | 
					    const char *want;
 | 
				
			||||||
    pa_proplist *pl, *parent_pl;
 | 
					    pa_proplist *pl, *parent_pl;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (is_sink_input) {
 | 
					    if (is_sink_input) {
 | 
				
			||||||
| 
						 | 
					@ -92,13 +92,6 @@ static pa_hook_result_t process(struct userdata *u, pa_object *o, pa_bool_t is_s
 | 
				
			||||||
    if (!pa_proplist_gets(pl, PA_PROP_FILTER_HEURISTICS) && pa_proplist_gets(pl, PA_PROP_FILTER_APPLY))
 | 
					    if (!pa_proplist_gets(pl, PA_PROP_FILTER_HEURISTICS) && pa_proplist_gets(pl, PA_PROP_FILTER_APPLY))
 | 
				
			||||||
        return PA_HOOK_OK;
 | 
					        return PA_HOOK_OK;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    want = pa_proplist_gets(pl, PA_PROP_FILTER_WANT);
 | 
					 | 
				
			||||||
    if (!want) {
 | 
					 | 
				
			||||||
        /* This is a phone stream, maybe we want echo cancellation */
 | 
					 | 
				
			||||||
        if ((stream_role = pa_proplist_gets(pl, PA_PROP_MEDIA_ROLE)) && pa_streq(stream_role, "phone"))
 | 
					 | 
				
			||||||
            want = "echo-cancel";
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /* On phone sinks, make sure we're not applying echo cancellation */
 | 
					    /* On phone sinks, make sure we're not applying echo cancellation */
 | 
				
			||||||
    if (role_match(parent_pl, "phone")) {
 | 
					    if (role_match(parent_pl, "phone")) {
 | 
				
			||||||
        const char *apply = pa_proplist_gets(pl, PA_PROP_FILTER_APPLY);
 | 
					        const char *apply = pa_proplist_gets(pl, PA_PROP_FILTER_APPLY);
 | 
				
			||||||
| 
						 | 
					@ -111,6 +104,8 @@ static pa_hook_result_t process(struct userdata *u, pa_object *o, pa_bool_t is_s
 | 
				
			||||||
        return PA_HOOK_OK;
 | 
					        return PA_HOOK_OK;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    want = pa_proplist_gets(pl, PA_PROP_FILTER_WANT);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (want) {
 | 
					    if (want) {
 | 
				
			||||||
        /* There's a filter that we want, ask module-filter-apply to apply it, and remember that we're managing filter.apply */
 | 
					        /* There's a filter that we want, ask module-filter-apply to apply it, and remember that we're managing filter.apply */
 | 
				
			||||||
        pa_proplist_sets(pl, PA_PROP_FILTER_APPLY, want);
 | 
					        pa_proplist_sets(pl, PA_PROP_FILTER_APPLY, want);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue