mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	impl-node: move quantum and rate
When we move a node from one driver to another, move the quantum and rate if the target driver was idle so that we can mostly continue uninterupted until a quantum/rate change is calculated.
This commit is contained in:
		
							parent
							
								
									a3fe226eac
								
							
						
					
					
						commit
						9423e8d648
					
				
					 1 changed files with 10 additions and 0 deletions
				
			
		| 
						 | 
					@ -789,7 +789,17 @@ int pw_impl_node_set_driver(struct pw_impl_node *node, struct pw_impl_node *driv
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	remove_segment_owner(old, node->info.id);
 | 
						remove_segment_owner(old, node->info.id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (old != node && old->driving && driver->info.state < PW_NODE_STATE_RUNNING) {
 | 
				
			||||||
 | 
							driver->rt.activation->position.clock.rate = old->rt.position->clock.rate;
 | 
				
			||||||
 | 
							driver->rt.activation->position.clock.duration = old->rt.position->clock.duration;
 | 
				
			||||||
 | 
							pw_log_info("move quantum:%"PRIu64" rate:%d (%s-%d -> %s-%d)",
 | 
				
			||||||
 | 
									driver->rt.activation->position.clock.duration,
 | 
				
			||||||
 | 
									driver->rt.activation->position.clock.rate.denom,
 | 
				
			||||||
 | 
									old->name, old->info.id,
 | 
				
			||||||
 | 
									driver->name, driver->info.id);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	node->driving = node->driver && driver == node;
 | 
						node->driving = node->driver && driver == node;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pw_log_debug(NAME" %p: driver %p driving:%u", node,
 | 
						pw_log_debug(NAME" %p: driver %p driving:%u", node,
 | 
				
			||||||
		driver, node->driving);
 | 
							driver, node->driving);
 | 
				
			||||||
	pw_log_info("(%s-%u) -> change driver (%s-%d -> %s-%d)",
 | 
						pw_log_info("(%s-%u) -> change driver (%s-%d -> %s-%d)",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue