mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
audiomixer: fix EnumFormat
When a format is set on one of the ports, only return that format from EnumFormat.
This commit is contained in:
parent
0eb44b340a
commit
865f671195
1 changed files with 21 additions and 11 deletions
|
|
@ -370,17 +370,27 @@ static int port_enum_formats(struct spa_node *node,
|
||||||
|
|
||||||
switch (*index) {
|
switch (*index) {
|
||||||
case 0:
|
case 0:
|
||||||
*param = spa_pod_builder_object(builder,
|
if (this->have_format) {
|
||||||
t->param.idEnumFormat, t->format,
|
*param = spa_pod_builder_object(builder,
|
||||||
"I", t->media_type.audio,
|
t->param.idEnumFormat, t->format,
|
||||||
"I", t->media_subtype.raw,
|
"I", t->media_type.audio,
|
||||||
":", t->format_audio.format, "Ieu", t->audio_format.S16,
|
"I", t->media_subtype.raw,
|
||||||
2, t->audio_format.S16,
|
":", t->format_audio.format, "I", this->format.info.raw.format,
|
||||||
t->audio_format.F32,
|
":", t->format_audio.rate, "i", this->format.info.raw.rate,
|
||||||
":", t->format_audio.rate, "iru", 44100,
|
":", t->format_audio.channels, "i", this->format.info.raw.channels);
|
||||||
2, 1, INT32_MAX,
|
} else {
|
||||||
":", t->format_audio.channels, "iru", 2,
|
*param = spa_pod_builder_object(builder,
|
||||||
2, 1, INT32_MAX);
|
t->param.idEnumFormat, t->format,
|
||||||
|
"I", t->media_type.audio,
|
||||||
|
"I", t->media_subtype.raw,
|
||||||
|
":", t->format_audio.format, "Ieu", t->audio_format.S16,
|
||||||
|
2, t->audio_format.S16,
|
||||||
|
t->audio_format.F32,
|
||||||
|
":", t->format_audio.rate, "iru", 44100,
|
||||||
|
2, 1, INT32_MAX,
|
||||||
|
":", t->format_audio.channels, "iru", 2,
|
||||||
|
2, 1, INT32_MAX);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue