mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	audioconvert: clear format and buffers on start error.
When we get an error, clear the ready state again and also clear the format a buffers that we might have negotiated before starting.
This commit is contained in:
		
							parent
							
								
									9e7921b37d
								
							
						
					
					
						commit
						8f7acb717c
					
				
					 1 changed files with 9 additions and 5 deletions
				
			
		| 
						 | 
					@ -867,21 +867,25 @@ static int impl_node_send_command(void *object, const struct spa_command *comman
 | 
				
			||||||
		spa_log_error(this->log, "%p: can't send command %d: %s",
 | 
							spa_log_error(this->log, "%p: can't send command %d: %s",
 | 
				
			||||||
				this, SPA_NODE_COMMAND_ID(command),
 | 
									this, SPA_NODE_COMMAND_ID(command),
 | 
				
			||||||
				spa_strerror(res));
 | 
									spa_strerror(res));
 | 
				
			||||||
		return res;
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (this->target != this->follower) {
 | 
						if (res >= 0 && this->target != this->follower) {
 | 
				
			||||||
		if ((res = spa_node_send_command(this->follower, command)) < 0) {
 | 
							if ((res = spa_node_send_command(this->follower, command)) < 0) {
 | 
				
			||||||
			spa_log_error(this->log, "%p: can't send command %d: %s",
 | 
								spa_log_error(this->log, "%p: can't send command %d: %s",
 | 
				
			||||||
					this, SPA_NODE_COMMAND_ID(command),
 | 
										this, SPA_NODE_COMMAND_ID(command),
 | 
				
			||||||
					spa_strerror(res));
 | 
										spa_strerror(res));
 | 
				
			||||||
			return res;
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	switch (SPA_NODE_COMMAND_ID(command)) {
 | 
						switch (SPA_NODE_COMMAND_ID(command)) {
 | 
				
			||||||
	case SPA_NODE_COMMAND_Start:
 | 
						case SPA_NODE_COMMAND_Start:
 | 
				
			||||||
		this->started = true;
 | 
							if (res < 0) {
 | 
				
			||||||
		spa_log_debug(this->log, "%p: started", this);
 | 
								spa_log_debug(this->log, "%p: start failed", this);
 | 
				
			||||||
 | 
								this->ready = false;
 | 
				
			||||||
 | 
								configure_format(this, 0, NULL);
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								this->started = true;
 | 
				
			||||||
 | 
								spa_log_debug(this->log, "%p: started", this);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	case SPA_NODE_COMMAND_Suspend:
 | 
						case SPA_NODE_COMMAND_Suspend:
 | 
				
			||||||
		configure_format(this, 0, NULL);
 | 
							configure_format(this, 0, NULL);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue