mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	context: add property to forcefully disable shared memory channels
If application wants last bits of virtual memory, allow it to forcefully disable shared memory communication channels via PA_PROP_CONTEXT_FORCE_DISABLE_SHM=yes Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/448>
This commit is contained in:
		
							parent
							
								
									4874f8a607
								
							
						
					
					
						commit
						3ecea410d7
					
				
					 2 changed files with 14 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -128,6 +128,7 @@ static void reset_callbacks(pa_context *c) {
 | 
			
		|||
pa_context *pa_context_new_with_proplist(pa_mainloop_api *mainloop, const char *name, const pa_proplist *p) {
 | 
			
		||||
    pa_context *c;
 | 
			
		||||
    pa_mem_type_t type;
 | 
			
		||||
    const char *force_disable_shm_str;
 | 
			
		||||
 | 
			
		||||
    pa_assert(mainloop);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -173,6 +174,16 @@ pa_context *pa_context_new_with_proplist(pa_mainloop_api *mainloop, const char *
 | 
			
		|||
    c->conf = pa_client_conf_new();
 | 
			
		||||
    pa_client_conf_load(c->conf, true, true);
 | 
			
		||||
 | 
			
		||||
    force_disable_shm_str = pa_proplist_gets(c->proplist, PA_PROP_CONTEXT_FORCE_DISABLE_SHM);
 | 
			
		||||
    if (force_disable_shm_str) {
 | 
			
		||||
        int b = pa_parse_boolean(force_disable_shm_str);
 | 
			
		||||
        if (b < 0) {
 | 
			
		||||
            pa_log_warn("Ignored invalid value for '%s' property: %s", PA_PROP_CONTEXT_FORCE_DISABLE_SHM, force_disable_shm_str);
 | 
			
		||||
        } else if (b) {
 | 
			
		||||
            c->conf->disable_shm = true;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    c->srb_template.readfd = -1;
 | 
			
		||||
    c->srb_template.writefd = -1;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue