mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	audioadapter: clear started flag earlier
First clear the started flag so that we ignore scheduling from the follower. Then stop the follower and the converter. This is the sequence we follow when deactivating a node, so do the same here. it is important that the node is not scheduled anymore when we clear the format in suspend or else we might crash. See #2877
This commit is contained in:
		
							parent
							
								
									3e000c11c4
								
							
						
					
					
						commit
						cf3d4c3b5d
					
				
					 1 changed files with 5 additions and 3 deletions
				
			
		| 
						 | 
					@ -852,9 +852,11 @@ static int impl_node_send_command(void *object, const struct spa_command *comman
 | 
				
			||||||
		this->started = true;
 | 
							this->started = true;
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	case SPA_NODE_COMMAND_Suspend:
 | 
						case SPA_NODE_COMMAND_Suspend:
 | 
				
			||||||
 | 
							this->started = false;
 | 
				
			||||||
		spa_log_debug(this->log, "%p: suspending", this);
 | 
							spa_log_debug(this->log, "%p: suspending", this);
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	case SPA_NODE_COMMAND_Pause:
 | 
						case SPA_NODE_COMMAND_Pause:
 | 
				
			||||||
 | 
							this->started = false;
 | 
				
			||||||
		spa_log_debug(this->log, "%p: pausing", this);
 | 
							spa_log_debug(this->log, "%p: pausing", this);
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	case SPA_NODE_COMMAND_Flush:
 | 
						case SPA_NODE_COMMAND_Flush:
 | 
				
			||||||
| 
						 | 
					@ -886,10 +888,10 @@ static int impl_node_send_command(void *object, const struct spa_command *comman
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	case SPA_NODE_COMMAND_Suspend:
 | 
						case SPA_NODE_COMMAND_Suspend:
 | 
				
			||||||
		configure_format(this, 0, NULL);
 | 
							configure_format(this, 0, NULL);
 | 
				
			||||||
		SPA_FALLTHROUGH
 | 
							spa_log_debug(this->log, "%p: suspended", this);
 | 
				
			||||||
 | 
							break;
 | 
				
			||||||
	case SPA_NODE_COMMAND_Pause:
 | 
						case SPA_NODE_COMMAND_Pause:
 | 
				
			||||||
		this->started = false;
 | 
							spa_log_debug(this->log, "%p: paused", this);
 | 
				
			||||||
		spa_log_debug(this->log, "%p: stopped", this);
 | 
					 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	case SPA_NODE_COMMAND_Flush:
 | 
						case SPA_NODE_COMMAND_Flush:
 | 
				
			||||||
		spa_log_debug(this->log, "%p: flushed", this);
 | 
							spa_log_debug(this->log, "%p: flushed", this);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue