PipeWire: Fix a bug with channel map negotiation.

This commit is contained in:
David Reid
2026-01-07 16:57:31 +10:00
parent 3b0391ad44
commit ca6361db5e
@@ -2229,9 +2229,14 @@ static void ma_stream_event_param_changed__pipewire(void* pUserData, ma_uint32 i
pStreamState->channels = channels; pStreamState->channels = channels;
pStreamState->sampleRate = sampleRate; pStreamState->sampleRate = sampleRate;
for (iChannel = 0; iChannel < MA_MAX_CHANNELS; iChannel += 1) { /* We should always get a channel map, but just to be safe we'll check for it, and if we don't get one back we'll use a default. */
if (pChannelPositionsPA != NULL) {
for (iChannel = 0; iChannel < channels; iChannel += 1) {
pStreamState->channelMap[iChannel] = ma_channel_from_pipewire(pChannelPositionsPA[iChannel]); pStreamState->channelMap[iChannel] = ma_channel_from_pipewire(pChannelPositionsPA[iChannel]);
} }
} else {
ma_channel_map_init_standard(ma_standard_channel_map_alsa, pStreamState->channelMap, ma_countof(pStreamState->channelMap), channels);
}
/* Now that we know both the buffer size and sample rate we can update the latency on the PipeWire side. */ /* Now that we know both the buffer size and sample rate we can update the latency on the PipeWire side. */