1 From afbc0ce57aac7aee8dc1651de4620f15c73dbace Mon Sep 17 00:00:00 2001
2 From: Wim Taymans <wtaymans@redhat.com>
3 Date: Mon, 21 Feb 2022 15:21:36 +0100
4 Subject: [PATCH] si-audio-adapter: relax format parsing
6 Some nodes can omit the format/rate/channels to indicate that they can
7 deal with all possibilities and adapt to what they are linked to.
11 modules/module-si-audio-adapter.c | 11 ++---------
12 1 file changed, 2 insertions(+), 9 deletions(-)
14 diff --git a/modules/module-si-audio-adapter.c b/modules/module-si-audio-adapter.c
15 index f1f62185..84e393fd 100644
16 --- a/modules/module-si-audio-adapter.c
17 +++ b/modules/module-si-audio-adapter.c
18 @@ -158,19 +158,12 @@ si_audio_adapter_find_format (WpSiAudioAdapter * self, WpNode * node)
19 struct spa_pod *position = NULL;
20 wp_spa_pod_fixate (pod);
24 - raw_format.format = SPA_AUDIO_FORMAT_F32;
25 - raw_format.rate = si_audio_adapter_get_default_clock_rate (self);
26 - raw_format.channels = 2;
27 - raw_format.position[0] = SPA_AUDIO_CHANNEL_FL;
28 - raw_format.position[1] = SPA_AUDIO_CHANNEL_FR;
30 if (spa_pod_parse_object(wp_spa_pod_get_spa_pod (pod),
31 SPA_TYPE_OBJECT_Format, NULL,
32 - SPA_FORMAT_AUDIO_format, SPA_POD_Id(&raw_format.format),
33 + SPA_FORMAT_AUDIO_format, SPA_POD_OPT_Id(&raw_format.format),
34 SPA_FORMAT_AUDIO_rate, SPA_POD_OPT_Int(&raw_format.rate),
35 - SPA_FORMAT_AUDIO_channels, SPA_POD_Int(&raw_format.channels),
36 + SPA_FORMAT_AUDIO_channels, SPA_POD_OPT_Int(&raw_format.channels),
37 SPA_FORMAT_AUDIO_position, SPA_POD_OPT_Pod(&position)) < 0)