mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	try to vacuum a little when nothing is going on
This commit is contained in:
		
							parent
							
								
									e8d7c50c00
								
							
						
					
					
						commit
						620bf84573
					
				
					 4 changed files with 17 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -250,3 +250,14 @@ int pa_core_exit(pa_core *c, pa_bool_t force, int retval) {
 | 
			
		|||
    c->mainloop->quit(c->mainloop, retval);
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void pa_core_maybe_vacuum(pa_core *c) {
 | 
			
		||||
    pa_assert(c);
 | 
			
		||||
 | 
			
		||||
    if (!pa_idxset_isempty(c->sink_inputs) ||
 | 
			
		||||
        !pa_idxset_isempty(c->source_outputs))
 | 
			
		||||
        return;
 | 
			
		||||
 | 
			
		||||
    pa_log_debug("Hmm, no streams around, trying to vacuum.");
 | 
			
		||||
    pa_mempool_vacuum(c->mempool);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -171,4 +171,6 @@ void pa_core_check_idle(pa_core *c);
 | 
			
		|||
 | 
			
		||||
int pa_core_exit(pa_core *c, pa_bool_t force, int retval);
 | 
			
		||||
 | 
			
		||||
void pa_core_maybe_vacuum(pa_core *c);
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -468,6 +468,8 @@ void pa_sink_input_unlink(pa_sink_input *i) {
 | 
			
		|||
        i->sink = NULL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    pa_core_maybe_vacuum(i->core);
 | 
			
		||||
 | 
			
		||||
    pa_sink_input_unref(i);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -335,6 +335,8 @@ void pa_source_output_unlink(pa_source_output*o) {
 | 
			
		|||
        o->source = NULL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    pa_core_maybe_vacuum(o->core);
 | 
			
		||||
 | 
			
		||||
    pa_source_output_unref(o);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue