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
a16d3e64
Commit
a16d3e64
authored
Apr 16, 2017
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove some old unused code.
parent
3f8b716e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
39 deletions
+3
-39
mini_al.h
mini_al.h
+3
-39
No files found.
mini_al.h
View file @
a16d3e64
...
@@ -257,6 +257,7 @@ typedef void (* mal_proc)();
...
@@ -257,6 +257,7 @@ typedef void (* mal_proc)();
#define MAL_MAX_PERIODS_DSOUND 4
#define MAL_MAX_PERIODS_DSOUND 4
#define MAL_MAX_PERIODS_OPENAL 4
#define MAL_MAX_PERIODS_OPENAL 4
#define MAL_CHANNEL_NONE 0
#define MAL_CHANNEL_FRONT_LEFT 1
#define MAL_CHANNEL_FRONT_LEFT 1
#define MAL_CHANNEL_FRONT_RIGHT 2
#define MAL_CHANNEL_FRONT_RIGHT 2
#define MAL_CHANNEL_FRONT_CENTER 3
#define MAL_CHANNEL_FRONT_CENTER 3
...
@@ -449,6 +450,7 @@ struct mal_dsp
...
@@ -449,6 +450,7 @@ struct mal_dsp
mal_dsp_read_proc
onRead
;
mal_dsp_read_proc
onRead
;
void
*
pUserDataForOnRead
;
void
*
pUserDataForOnRead
;
mal_src
src
;
// For sample rate conversion.
mal_src
src
;
// For sample rate conversion.
mal_uint8
channelShuffleTable
[
MAL_MAX_CHANNELS
];
mal_bool32
isUsingForeignChannelMap
:
1
;
mal_bool32
isUsingForeignChannelMap
:
1
;
mal_bool32
isSRCRequired
:
1
;
mal_bool32
isSRCRequired
:
1
;
mal_bool32
isPassthrough
:
1
;
// <-- Will be set to true when the DSP pipeline is an optimized passthrough.
mal_bool32
isPassthrough
:
1
;
// <-- Will be set to true when the DSP pipeline is an optimized passthrough.
...
@@ -629,7 +631,6 @@ struct mal_device
...
@@ -629,7 +631,6 @@ struct mal_device
mal_uint32
internalChannels
;
mal_uint32
internalChannels
;
mal_uint32
internalSampleRate
;
mal_uint32
internalSampleRate
;
mal_uint8
internalChannelMap
[
MAL_MAX_CHANNELS
];
mal_uint8
internalChannelMap
[
MAL_MAX_CHANNELS
];
mal_uint8
channelShuffleTable
[
MAL_MAX_CHANNELS
];
mal_dsp
dsp
;
// Samples run through this to convert samples to a format suitable for use by the backend.
mal_dsp
dsp
;
// Samples run through this to convert samples to a format suitable for use by the backend.
mal_uint32
_dspFrameCount
;
// Internal use only. Used when running the device -> DSP -> client pipeline. See mal_device__on_read_from_device().
mal_uint32
_dspFrameCount
;
// Internal use only. Used when running the device -> DSP -> client pipeline. See mal_device__on_read_from_device().
const
mal_uint8
*
_dspFrames
;
// ^^^ AS ABOVE ^^^
const
mal_uint8
*
_dspFrames
;
// ^^^ AS ABOVE ^^^
...
@@ -1125,10 +1126,6 @@ typedef HRESULT (WINAPI * MAL_PFN_PropVariantClear)(PROPVARIANT *pvar);
...
@@ -1125,10 +1126,6 @@ typedef HRESULT (WINAPI * MAL_PFN_PropVariantClear)(PROPVARIANT *pvar);
#define MAL_DEVICE_FLAG_USING_DEFAULT_BUFFER_SIZE (1 << 0)
#define MAL_DEVICE_FLAG_USING_DEFAULT_BUFFER_SIZE (1 << 0)
#define MAL_DEVICE_FLAG_USING_DEFAULT_PERIODS (1 << 1)
#define MAL_DEVICE_FLAG_USING_DEFAULT_PERIODS (1 << 1)
#define MAL_DEVICE_FLAG_USING_FOREIGN_FORMAT (1 << 2) // The backend's native format is different to the format requested by the client.
#define MAL_DEVICE_FLAG_USING_FOREIGN_CHANNELS (1 << 3) // The backend's native channel count is different to the count requested by the client.
#define MAL_DEVICE_FLAG_USING_FOREIGN_SAMPLE_RATE (1 << 4) // The backend's native sample rate is different to the rate requested by the client.
#define MAL_DEVICE_FLAG_USING_FOREIGN_CHANNEL_MAP (1 << 5)
// The default size of the device's buffer in milliseconds.
// The default size of the device's buffer in milliseconds.
...
@@ -5527,39 +5524,6 @@ mal_result mal_device_init(mal_context* pContext, mal_device_type type, mal_devi
...
@@ -5527,39 +5524,6 @@ mal_result mal_device_init(mal_context* pContext, mal_device_type type, mal_devi
}
}
// Some flags need to be set if the backend is using a different internal format, channel count or sample rate.
// TODO: Verify that these flags are still being used.
if
(
pDevice
->
format
!=
pDevice
->
internalFormat
)
{
pDevice
->
flags
|=
MAL_DEVICE_FLAG_USING_FOREIGN_FORMAT
;
}
if
(
pDevice
->
channels
!=
pDevice
->
internalChannels
)
{
pDevice
->
flags
|=
MAL_DEVICE_FLAG_USING_FOREIGN_CHANNELS
;
}
if
(
pDevice
->
sampleRate
!=
pDevice
->
internalSampleRate
)
{
pDevice
->
flags
|=
MAL_DEVICE_FLAG_USING_FOREIGN_SAMPLE_RATE
;
}
for
(
mal_uint32
i
=
0
;
i
<
pDevice
->
channels
&&
i
<
pDevice
->
internalChannels
;
++
i
)
{
if
(
pDevice
->
channelMap
[
i
]
!=
pDevice
->
internalChannelMap
[
i
])
{
pDevice
->
flags
|=
MAL_DEVICE_FLAG_USING_FOREIGN_CHANNEL_MAP
;
break
;
}
}
// When we do channel shuffling we will need to know how each channel index maps between the client and the device.
if
(
pDevice
->
flags
&
MAL_DEVICE_FLAG_USING_FOREIGN_CHANNEL_MAP
)
{
if
(
type
==
mal_device_type_playback
)
{
for
(
mal_uint32
i
=
0
;
i
<
pDevice
->
channels
&&
i
<
pDevice
->
internalChannels
;
++
i
)
{
pDevice
->
channelShuffleTable
[
i
]
=
(
mal_uint8
)
i
;
}
}
else
{
for
(
mal_uint32
i
=
0
;
i
<
pDevice
->
channels
&&
i
<
pDevice
->
internalChannels
;
++
i
)
{
pDevice
->
channelShuffleTable
[
i
]
=
(
mal_uint8
)
i
;
}
}
}
// We need a DSP object which is where samples are moved through in order to convert them to the
// We need a DSP object which is where samples are moved through in order to convert them to the
// format required by the backend.
// format required by the backend.
mal_dsp_config
dspConfig
;
mal_dsp_config
dspConfig
;
...
...
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