mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-18 08:56:45 -05:00
fmtconvert: place unknown channels at end
Sort the unknown channels to the end of the remap array.
This commit is contained in:
parent
f6bc9113ce
commit
320e63fe48
1 changed files with 10 additions and 3 deletions
|
|
@ -178,9 +178,10 @@ static int setup_convert(struct impl *this)
|
||||||
outformat.info.raw.position[j])
|
outformat.info.raw.position[j])
|
||||||
continue;
|
continue;
|
||||||
this->remap[i] = j;
|
this->remap[i] = j;
|
||||||
|
spa_log_debug(this->log, NAME " %p: channel %d -> %d (%d -> %d)", this,
|
||||||
|
i, j, informat.info.raw.position[i],
|
||||||
|
outformat.info.raw.position[j]);
|
||||||
outformat.info.raw.position[j] = -1;
|
outformat.info.raw.position[j] = -1;
|
||||||
spa_log_debug(this->log, NAME " %p: channel %d -> %d (%d)", this,
|
|
||||||
i, j, informat.info.raw.position[i]);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -317,7 +318,13 @@ impl_node_remove_port(void *object, enum spa_direction direction, uint32_t port_
|
||||||
|
|
||||||
static int int32_cmp(const void *v1, const void *v2)
|
static int int32_cmp(const void *v1, const void *v2)
|
||||||
{
|
{
|
||||||
return *(int32_t*)v1 - *(int32_t*)v2;
|
int32_t a1 = *(int32_t*)v1;
|
||||||
|
int32_t a2 = *(int32_t*)v2;
|
||||||
|
if (a1 == 0 && a2 != 0)
|
||||||
|
return 1;
|
||||||
|
if (a2 == 0 && a1 != 0)
|
||||||
|
return -1;
|
||||||
|
return a1 - a2;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int port_enum_formats(void *object,
|
static int port_enum_formats(void *object,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue