Skip to content

Commit

Permalink
Try fixing a channel mapping related error with PipeWire.
Browse files Browse the repository at this point in the history
  • Loading branch information
mackron committed Mar 28, 2023
1 parent 21cf0e3 commit 2ce573d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions miniaudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -30233,6 +30233,14 @@ static ma_result ma_device_init__pulse(ma_device* pDevice, const ma_device_confi
ss = sourceInfo.sample_spec;
cmap = sourceInfo.channel_map;

/* Use the requested channel count if we have one. */
if (pDescriptorCapture->channels != 0) {
ss.channels = pDescriptorCapture->channels;
}

/* Use a default channel map. */
((ma_pa_channel_map_init_extend_proc)pDevice->pContext->pulse.pa_channel_map_init_extend)(&cmap, ss.channels, MA_PA_CHANNEL_MAP_DEFAULT);

/* Use the requested sample rate if one was specified. */
if (pDescriptorCapture->sampleRate != 0) {
ss.rate = pDescriptorCapture->sampleRate;
Expand Down Expand Up @@ -30374,6 +30382,15 @@ static ma_result ma_device_init__pulse(ma_device* pDevice, const ma_device_confi
ss = sinkInfo.sample_spec;
cmap = sinkInfo.channel_map;

/* Use the requested channel count if we have one. */
if (pDescriptorPlayback->channels != 0) {
ss.channels = pDescriptorPlayback->channels;
}

/* Use a default channel map. */
((ma_pa_channel_map_init_extend_proc)pDevice->pContext->pulse.pa_channel_map_init_extend)(&cmap, ss.channels, MA_PA_CHANNEL_MAP_DEFAULT);


/* Use the requested sample rate if one was specified. */
if (pDescriptorPlayback->sampleRate != 0) {
ss.rate = pDescriptorPlayback->sampleRate;
Expand Down

0 comments on commit 2ce573d

Please sign in to comment.