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:
Wim Taymans 2023-04-28 10:47:30 +02:00
parent 9e7921b37d
commit 8f7acb717c

View file

@ -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",
this, SPA_NODE_COMMAND_ID(command),
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) {
spa_log_error(this->log, "%p: can't send command %d: %s",
this, SPA_NODE_COMMAND_ID(command),
spa_strerror(res));
return res;
}
}
switch (SPA_NODE_COMMAND_ID(command)) {
case SPA_NODE_COMMAND_Start:
this->started = true;
spa_log_debug(this->log, "%p: started", this);
if (res < 0) {
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;
case SPA_NODE_COMMAND_Suspend:
configure_format(this, 0, NULL);