mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
audioconvert: improve renegotiation
When the follower updates EnumFormat, it probably wants to renegotiate to a new format, so clear the current format so that we do that when starting the next time. EnumFormat should also not only return the current format in case we are negotiated but it should return all possible formats. See #2832
This commit is contained in:
parent
72912c9589
commit
90f5b4a4bf
2 changed files with 5 additions and 6 deletions
|
|
@ -1096,6 +1096,10 @@ static void follower_port_info(void *data,
|
|||
spa_log_debug(this->log, "latency: %d (%s)", res,
|
||||
spa_strerror(res));
|
||||
}
|
||||
if (idx == IDX_EnumFormat) {
|
||||
this->have_format = false;
|
||||
spa_log_debug(this->log, "new formats");
|
||||
}
|
||||
|
||||
this->info.change_mask |= SPA_NODE_CHANGE_MASK_PARAMS;
|
||||
if (!this->add_listener) {
|
||||
|
|
|
|||
|
|
@ -1646,7 +1646,6 @@ static int port_enum_formats(void *object,
|
|||
struct spa_pod_builder *builder)
|
||||
{
|
||||
struct impl *this = object;
|
||||
struct port *port = GET_PORT(this, direction, port_id);
|
||||
|
||||
switch (index) {
|
||||
case 0:
|
||||
|
|
@ -1660,11 +1659,7 @@ static int port_enum_formats(void *object,
|
|||
SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat,
|
||||
SPA_FORMAT_mediaType, SPA_POD_Id(SPA_MEDIA_TYPE_application),
|
||||
SPA_FORMAT_mediaSubtype, SPA_POD_Id(SPA_MEDIA_SUBTYPE_control));
|
||||
} else if (port->have_format) {
|
||||
*param = spa_format_audio_raw_build(builder,
|
||||
SPA_PARAM_EnumFormat, &this->dir[direction].format.info.raw);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
uint32_t rate = this->io_position ?
|
||||
this->io_position->clock.rate.denom : DEFAULT_RATE;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue