mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	filter-chain: reset graph in suspend
To make sure we don't end up with samples from before the suspend.
This commit is contained in:
		
							parent
							
								
									32688d7fc6
								
							
						
					
					
						commit
						a6c0e35b13
					
				
					 1 changed files with 17 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -553,6 +553,19 @@ static int parse_params(struct graph *graph, const struct spa_pod *pod)
 | 
			
		|||
	return changed;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void graph_reset(struct graph *graph)
 | 
			
		||||
{
 | 
			
		||||
	uint32_t i;
 | 
			
		||||
	for (i = 0; i < graph->n_hndl; i++) {
 | 
			
		||||
		struct graph_hndl *hndl = &graph->hndl[i];
 | 
			
		||||
		const LADSPA_Descriptor *d = hndl->desc;
 | 
			
		||||
		if (d->deactivate)
 | 
			
		||||
			d->deactivate(hndl->hndl);
 | 
			
		||||
		if (d->activate)
 | 
			
		||||
			d->activate(hndl->hndl);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void param_changed(void *data, uint32_t id, const struct spa_pod *param)
 | 
			
		||||
{
 | 
			
		||||
	struct impl *impl = data;
 | 
			
		||||
| 
						 | 
				
			
			@ -561,6 +574,10 @@ static void param_changed(void *data, uint32_t id, const struct spa_pod *param)
 | 
			
		|||
	struct graph *graph = &impl->graph;
 | 
			
		||||
	int changed = 0;
 | 
			
		||||
 | 
			
		||||
	if (id == SPA_PARAM_Format && param == NULL) {
 | 
			
		||||
		graph_reset(graph);
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	if (id != SPA_PARAM_Props)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue