audioconvert: don't clear profile when format is cleared

This commit is contained in:
Wim Taymans 2018-11-02 17:19:15 +01:00
parent 4733bd32c8
commit 7b6df9e127
2 changed files with 14 additions and 2 deletions

View file

@ -88,6 +88,8 @@ struct impl {
bool started;
convert_func_t convert;
bool have_profile;
float empty[MAX_SAMPLES];
};
@ -203,6 +205,7 @@ static int impl_node_set_param(struct spa_node *node, uint32_t id, uint32_t flag
port->have_format = true;
port->format = info;
this->have_profile = true;
this->port_count = info.info.raw.channels;
for (i = 0; i < this->port_count; i++) {
init_port(this, i, info.info.raw.rate,
@ -582,6 +585,9 @@ static int port_set_format(struct spa_node *node,
if (format == NULL) {
if (port->have_format) {
if (direction == SPA_DIRECTION_OUTPUT)
port->have_format = this->have_profile;
else
port->have_format = false;
clear_buffers(this, port);
}

View file

@ -89,6 +89,8 @@ struct impl {
bool started;
convert_func_t convert;
bool have_profile;
float empty[MAX_SAMPLES];
};
@ -204,6 +206,7 @@ static int impl_node_set_param(struct spa_node *node, uint32_t id, uint32_t flag
if (port->have_format && memcmp(&port->format, &info, sizeof(info)) == 0)
return 0;
this->have_profile = true;
this->port_count = info.info.raw.channels;
for (i = 0; i < this->port_count; i++) {
init_port(this, i, info.info.raw.rate,
@ -595,6 +598,9 @@ static int port_set_format(struct spa_node *node,
if (format == NULL) {
if (port->have_format) {
if (direction == SPA_DIRECTION_INPUT)
port->have_format = this->profile;
else
port->have_format = false;
clear_buffers(this, port);
}