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
679ae6de
Commit
679ae6de
authored
Jan 26, 2018
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix errors with channel mixing when increasing the channel count.
parent
bd744e7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
mini_al.h
mini_al.h
+20
-20
No files found.
mini_al.h
View file @
679ae6de
...
@@ -10760,7 +10760,7 @@ static void mal_dsp_mix_channels__inc(float* pFramesOut, mal_uint32 channelsOut,
...
@@ -10760,7 +10760,7 @@ static void mal_dsp_mix_channels__inc(float* pFramesOut, mal_uint32 channelsOut,
(
void
)
channelMapOut
;
(
void
)
channelMapOut
;
(
void
)
channelMapIn
;
(
void
)
channelMapIn
;
if
(
mode
==
mal_channel_mix_mode_basic
)
{
\
if
(
mode
==
mal_channel_mix_mode_basic
)
{
// Basic mode is where we just zero out extra channels.
// Basic mode is where we just zero out extra channels.
for
(
mal_uint32
iFrame
=
0
;
iFrame
<
frameCount
;
++
iFrame
)
{
for
(
mal_uint32
iFrame
=
0
;
iFrame
<
frameCount
;
++
iFrame
)
{
switch
(
channelsIn
)
{
switch
(
channelsIn
)
{
...
@@ -10785,23 +10785,23 @@ static void mal_dsp_mix_channels__inc(float* pFramesOut, mal_uint32 channelsOut,
...
@@ -10785,23 +10785,23 @@ static void mal_dsp_mix_channels__inc(float* pFramesOut, mal_uint32 channelsOut,
// Zero out extra channels.
// Zero out extra channels.
switch
(
channelsOut
-
channelsIn
)
{
switch
(
channelsOut
-
channelsIn
)
{
case
17
:
pFramesOut
[
iFrame
*
channelsOut
+
16
]
=
0
;
case
17
:
pFramesOut
[
iFrame
*
channelsOut
+
16
+
channelsIn
]
=
0
;
case
16
:
pFramesOut
[
iFrame
*
channelsOut
+
15
]
=
0
;
case
16
:
pFramesOut
[
iFrame
*
channelsOut
+
15
+
channelsIn
]
=
0
;
case
15
:
pFramesOut
[
iFrame
*
channelsOut
+
14
]
=
0
;
case
15
:
pFramesOut
[
iFrame
*
channelsOut
+
14
+
channelsIn
]
=
0
;
case
14
:
pFramesOut
[
iFrame
*
channelsOut
+
13
]
=
0
;
case
14
:
pFramesOut
[
iFrame
*
channelsOut
+
13
+
channelsIn
]
=
0
;
case
13
:
pFramesOut
[
iFrame
*
channelsOut
+
12
]
=
0
;
case
13
:
pFramesOut
[
iFrame
*
channelsOut
+
12
+
channelsIn
]
=
0
;
case
12
:
pFramesOut
[
iFrame
*
channelsOut
+
11
]
=
0
;
case
12
:
pFramesOut
[
iFrame
*
channelsOut
+
11
+
channelsIn
]
=
0
;
case
11
:
pFramesOut
[
iFrame
*
channelsOut
+
10
]
=
0
;
case
11
:
pFramesOut
[
iFrame
*
channelsOut
+
10
+
channelsIn
]
=
0
;
case
10
:
pFramesOut
[
iFrame
*
channelsOut
+
9
]
=
0
;
case
10
:
pFramesOut
[
iFrame
*
channelsOut
+
9
+
channelsIn
]
=
0
;
case
9
:
pFramesOut
[
iFrame
*
channelsOut
+
8
]
=
0
;
case
9
:
pFramesOut
[
iFrame
*
channelsOut
+
8
+
channelsIn
]
=
0
;
case
8
:
pFramesOut
[
iFrame
*
channelsOut
+
7
]
=
0
;
case
8
:
pFramesOut
[
iFrame
*
channelsOut
+
7
+
channelsIn
]
=
0
;
case
7
:
pFramesOut
[
iFrame
*
channelsOut
+
6
]
=
0
;
case
7
:
pFramesOut
[
iFrame
*
channelsOut
+
6
+
channelsIn
]
=
0
;
case
6
:
pFramesOut
[
iFrame
*
channelsOut
+
5
]
=
0
;
case
6
:
pFramesOut
[
iFrame
*
channelsOut
+
5
+
channelsIn
]
=
0
;
case
5
:
pFramesOut
[
iFrame
*
channelsOut
+
4
]
=
0
;
case
5
:
pFramesOut
[
iFrame
*
channelsOut
+
4
+
channelsIn
]
=
0
;
case
4
:
pFramesOut
[
iFrame
*
channelsOut
+
3
]
=
0
;
case
4
:
pFramesOut
[
iFrame
*
channelsOut
+
3
+
channelsIn
]
=
0
;
case
3
:
pFramesOut
[
iFrame
*
channelsOut
+
2
]
=
0
;
case
3
:
pFramesOut
[
iFrame
*
channelsOut
+
2
+
channelsIn
]
=
0
;
case
2
:
pFramesOut
[
iFrame
*
channelsOut
+
1
]
=
0
;
case
2
:
pFramesOut
[
iFrame
*
channelsOut
+
1
+
channelsIn
]
=
0
;
case
1
:
pFramesOut
[
iFrame
*
channelsOut
+
0
]
=
0
;
case
1
:
pFramesOut
[
iFrame
*
channelsOut
+
0
+
channelsIn
]
=
0
;
}
}
}
}
}
else
{
}
else
{
...
@@ -10832,10 +10832,10 @@ static void mal_dsp_mix_channels__inc(float* pFramesOut, mal_uint32 channelsOut,
...
@@ -10832,10 +10832,10 @@ static void mal_dsp_mix_channels__inc(float* pFramesOut, mal_uint32 channelsOut,
}
}
}
else
if
(
channelsIn
==
2
)
{
}
else
if
(
channelsIn
==
2
)
{
// TODO: Implement an optimized stereo conversion.
// TODO: Implement an optimized stereo conversion.
mal_dsp_mix_channels__
de
c
(
pFramesOut
,
channelsOut
,
channelMapOut
,
pFramesIn
,
channelsIn
,
channelMapIn
,
frameCount
,
mal_channel_mix_mode_basic
);
mal_dsp_mix_channels__
in
c
(
pFramesOut
,
channelsOut
,
channelMapOut
,
pFramesIn
,
channelsIn
,
channelMapIn
,
frameCount
,
mal_channel_mix_mode_basic
);
}
else
{
}
else
{
// Fall back to basic mixing mode.
// Fall back to basic mixing mode.
mal_dsp_mix_channels__
de
c
(
pFramesOut
,
channelsOut
,
channelMapOut
,
pFramesIn
,
channelsIn
,
channelMapIn
,
frameCount
,
mal_channel_mix_mode_basic
);
mal_dsp_mix_channels__
in
c
(
pFramesOut
,
channelsOut
,
channelMapOut
,
pFramesIn
,
channelsIn
,
channelMapIn
,
frameCount
,
mal_channel_mix_mode_basic
);
}
}
}
}
}
}
...
...
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