audio-format: set unpossisioned flag

If we don't have position information in the format, set the
unpositioned flag. Don't set position info in the format when the
unpositioned flag is set.
This commit is contained in:
Wim Taymans 2018-11-07 11:54:23 +01:00
parent aade499aae
commit 00a570f7de
2 changed files with 11 additions and 5 deletions

View file

@ -354,9 +354,11 @@ static int port_enum_formats(struct spa_node *node,
SPA_FORMAT_AUDIO_rate, &SPA_POD_Int(other->info.raw.rate),
SPA_FORMAT_AUDIO_channels, &SPA_POD_Int(other->info.raw.channels),
0);
spa_pod_builder_prop(builder, SPA_FORMAT_AUDIO_position, 0);
spa_pod_builder_array(builder, sizeof(uint32_t), SPA_TYPE_Id,
info.info.raw.channels, info.info.raw.position);
if (!SPA_FLAG_CHECK(other->info.raw.flags, SPA_AUDIO_FLAG_UNPOSITIONED)) {
spa_pod_builder_prop(builder, SPA_FORMAT_AUDIO_position, 0);
spa_pod_builder_array(builder, sizeof(uint32_t), SPA_TYPE_Id,
info.info.raw.channels, info.info.raw.position);
}
*param = spa_pod_builder_pop(builder);
} else {
*param = spa_pod_builder_object(builder,