Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
miniaudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
miniaudio
Commits
b454e7f1
Commit
b454e7f1
authored
Feb 28, 2024
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PulseAudio: Try fixing a channel mapping bug.
Public issue
https://github.com/mackron/miniaudio/issues/811
parent
feea2649
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
miniaudio.h
miniaudio.h
+17
-4
No files found.
miniaudio.h
View file @
b454e7f1
...
...
@@ -30388,6 +30388,7 @@ static ma_result ma_device_init__pulse(ma_device* pDevice, const ma_device_confi
ma_pa_buffer_attr attr;
const ma_pa_sample_spec* pActualSS = NULL;
const ma_pa_buffer_attr* pActualAttr = NULL;
const ma_pa_channel_map* pActualChannelMap = NULL;
ma_uint32 iChannel;
ma_pa_stream_flags_t streamFlags;
...
...
@@ -30537,7 +30538,12 @@ static ma_result ma_device_init__pulse(ma_device* pDevice, const ma_device_confi
goto on_error4;
}
/* Internal channel map. */
pActualChannelMap = ((ma_pa_stream_get_channel_map_proc)pDevice->pContext->pulse.pa_stream_get_channel_map)((ma_pa_stream*)pDevice->pulse.pStreamCapture);
if (pActualChannelMap == NULL) {
pActualChannelMap = &cmap; /* Fallback just in case. */
}
/*
Bug in PipeWire. There have been reports that PipeWire is returning AUX channels when reporting
...
...
@@ -30547,8 +30553,8 @@ static ma_result ma_device_init__pulse(ma_device* pDevice, const ma_device_confi
fixed sooner than later. I might remove this hack later.
*/
if (pDescriptorCapture->channels > 2) {
for (iChannel = 0; iChannel < pDescriptorCapture->channels;
++iChannel
) {
pDescriptorCapture->channelMap[iChannel] = ma_channel_position_from_pulse(
cmap.
map[iChannel]);
for (iChannel = 0; iChannel < pDescriptorCapture->channels;
iChannel += 1
) {
pDescriptorCapture->channelMap[iChannel] = ma_channel_position_from_pulse(
pActualChannelMap->
map[iChannel]);
}
} else {
/* Hack for mono and stereo. */
...
...
@@ -30689,7 +30695,12 @@ static ma_result ma_device_init__pulse(ma_device* pDevice, const ma_device_confi
goto on_error4;
}
/* Internal channel map. */
pActualChannelMap = ((ma_pa_stream_get_channel_map_proc)pDevice->pContext->pulse.pa_stream_get_channel_map)((ma_pa_stream*)pDevice->pulse.pStreamPlayback);
if (pActualChannelMap == NULL) {
pActualChannelMap = &cmap; /* Fallback just in case. */
}
/*
Bug in PipeWire. There have been reports that PipeWire is returning AUX channels when reporting
...
...
@@ -30699,8 +30710,8 @@ static ma_result ma_device_init__pulse(ma_device* pDevice, const ma_device_confi
fixed sooner than later. I might remove this hack later.
*/
if (pDescriptorPlayback->channels > 2) {
for (iChannel = 0; iChannel < pDescriptorPlayback->channels;
++iChannel
) {
pDescriptorPlayback->channelMap[iChannel] = ma_channel_position_from_pulse(
cmap.
map[iChannel]);
for (iChannel = 0; iChannel < pDescriptorPlayback->channels;
iChannel += 1
) {
pDescriptorPlayback->channelMap[iChannel] = ma_channel_position_from_pulse(
pActualChannelMap->
map[iChannel]);
}
} else {
/* Hack for mono and stereo. */
...
...
@@ -72068,6 +72079,8 @@ static ma_uint16 ma_node_config_get_cache_size_in_frames(const ma_node_config* p
{
ma_uint32 cacheSizeInFrames;
(void)pConfig;
if (pNodeGraph->processingSizeInFrames > 0) {
cacheSizeInFrames = pNodeGraph->processingSizeInFrames;
} else {
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment