mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-24 01:04:02 +02:00
PipeWire: Fix a bug with channel map negotiation.
This commit is contained in:
@@ -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. */
|
||||||
|
|||||||
Reference in New Issue
Block a user