Skip to content
Snippets Groups Projects
Commit afbc0ce5 authored by Wim Taymans's avatar Wim Taymans Committed by George Kiagiadakis
Browse files

si-audio-adapter: relax format parsing

Some nodes can omit the format/rate/channels to indicate that they can
deal with all possibilities and adapt to what they are linked to.

See pipewire#876
parent 33d105c2
No related branches found
No related tags found
Loading
......@@ -158,19 +158,12 @@ si_audio_adapter_find_format (WpSiAudioAdapter * self, WpNode * node)
struct spa_pod *position = NULL;
wp_spa_pod_fixate (pod);
/* defaults */
spa_zero(raw_format);
raw_format.format = SPA_AUDIO_FORMAT_F32;
raw_format.rate = si_audio_adapter_get_default_clock_rate (self);
raw_format.channels = 2;
raw_format.position[0] = SPA_AUDIO_CHANNEL_FL;
raw_format.position[1] = SPA_AUDIO_CHANNEL_FR;
if (spa_pod_parse_object(wp_spa_pod_get_spa_pod (pod),
SPA_TYPE_OBJECT_Format, NULL,
SPA_FORMAT_AUDIO_format, SPA_POD_Id(&raw_format.format),
SPA_FORMAT_AUDIO_format, SPA_POD_OPT_Id(&raw_format.format),
SPA_FORMAT_AUDIO_rate, SPA_POD_OPT_Int(&raw_format.rate),
SPA_FORMAT_AUDIO_channels, SPA_POD_Int(&raw_format.channels),
SPA_FORMAT_AUDIO_channels, SPA_POD_OPT_Int(&raw_format.channels),
SPA_FORMAT_AUDIO_position, SPA_POD_OPT_Pod(&position)) < 0)
continue;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment