spa: param: infer raw audio channels from position if unset

The behavior before b8eeb2db45 was that spa_audio_info_raw_update()
always sets audio.channels when audio.position is updated.  The new
behavior does not set audio.channels when parsing audio.position.

This breaks things e.g. when combine-sink and loopback nodes are created
with only audio.position specified.

Restore the previous behavior.
This commit is contained in:
Pauli Virtanen 2025-10-26 15:38:17 +02:00
parent 9f1a149876
commit 93495d3a75

View file

@ -78,6 +78,7 @@ spa_audio_info_raw_ext_update(struct spa_audio_info_raw *info, size_t size,
max_position, &v) > 0) { max_position, &v) > 0) {
if (v > max_position) if (v > max_position)
return -ECHRNG; return -ECHRNG;
info->channels = v;
SPA_FLAG_CLEAR(info->flags, SPA_AUDIO_FLAG_UNPOSITIONED); SPA_FLAG_CLEAR(info->flags, SPA_AUDIO_FLAG_UNPOSITIONED);
} }
} }