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
9af027d4
Commit
9af027d4
authored
Mar 10, 2018
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix non-Windows builds.
parent
ad130c35
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
mini_al.h
mini_al.h
+15
-2
No files found.
mini_al.h
View file @
9af027d4
...
@@ -2892,6 +2892,13 @@ mal_bool32 mal_event_signal(mal_event* pEvent)
...
@@ -2892,6 +2892,13 @@ mal_bool32 mal_event_signal(mal_event* pEvent)
}
}
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4505)
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#endif
static
mal_uint32
mal_get_best_sample_rate_within_range
(
mal_uint32
sampleRateMin
,
mal_uint32
sampleRateMax
)
static
mal_uint32
mal_get_best_sample_rate_within_range
(
mal_uint32
sampleRateMin
,
mal_uint32
sampleRateMax
)
{
{
// Normalize the range in case we were given something stupid.
// Normalize the range in case we were given something stupid.
...
@@ -2909,7 +2916,7 @@ static mal_uint32 mal_get_best_sample_rate_within_range(mal_uint32 sampleRateMin
...
@@ -2909,7 +2916,7 @@ static mal_uint32 mal_get_best_sample_rate_within_range(mal_uint32 sampleRateMin
return
sampleRateMax
;
return
sampleRateMax
;
}
else
{
}
else
{
for
(
size_t
iStandardRate
=
0
;
iStandardRate
<
mal_countof
(
g_malStandardSampleRatePriorities
);
++
iStandardRate
)
{
for
(
size_t
iStandardRate
=
0
;
iStandardRate
<
mal_countof
(
g_malStandardSampleRatePriorities
);
++
iStandardRate
)
{
DWORD
standardRate
=
g_malStandardSampleRatePriorities
[
iStandardRate
];
mal_uint32
standardRate
=
g_malStandardSampleRatePriorities
[
iStandardRate
];
if
(
standardRate
>=
sampleRateMin
&&
standardRate
<=
sampleRateMax
)
{
if
(
standardRate
>=
sampleRateMin
&&
standardRate
<=
sampleRateMax
)
{
return
standardRate
;
return
standardRate
;
}
}
...
@@ -2920,6 +2927,11 @@ static mal_uint32 mal_get_best_sample_rate_within_range(mal_uint32 sampleRateMin
...
@@ -2920,6 +2927,11 @@ static mal_uint32 mal_get_best_sample_rate_within_range(mal_uint32 sampleRateMin
mal_assert
(
MAL_FALSE
);
mal_assert
(
MAL_FALSE
);
return
0
;
return
0
;
}
}
#if defined(_MSC_VER)
#pragma warning(pop)
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
// Posts a log message.
// Posts a log message.
...
@@ -3518,7 +3530,6 @@ static mal_result mal_device__main_loop__null(mal_device* pDevice)
...
@@ -3518,7 +3530,6 @@ static mal_result mal_device__main_loop__null(mal_device* pDevice)
#define mal_CoTaskMemFree(pContext, pv) CoTaskMemFree(pv)
#define mal_CoTaskMemFree(pContext, pv) CoTaskMemFree(pv)
#define mal_PropVariantClear(pContext, pvar) PropVariantClear(pvar)
#define mal_PropVariantClear(pContext, pvar) PropVariantClear(pvar)
#endif
#endif
#endif
// There's a few common headers for Win32 backends which include here for simplicity. Note that we should never
// There's a few common headers for Win32 backends which include here for simplicity. Note that we should never
// include any files that do not come standard with modern compilers, and we may need to manually define a few
// include any files that do not come standard with modern compilers, and we may need to manually define a few
...
@@ -3741,6 +3752,7 @@ static mal_format mal_format_from_WAVEFORMATEX(WAVEFORMATEX* pWF)
...
@@ -3741,6 +3752,7 @@ static mal_format mal_format_from_WAVEFORMATEX(WAVEFORMATEX* pWF)
return
mal_format_unknown
;
return
mal_format_unknown
;
}
}
#endif
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
...
@@ -7338,6 +7350,7 @@ static mal_result mal_device_init__alsa(mal_context* pContext, mal_device_type t
...
@@ -7338,6 +7350,7 @@ static mal_result mal_device_init__alsa(mal_context* pContext, mal_device_type t
return
mal_post_error
(
pDevice
,
"[ALSA] The chosen format is not supported by mini_al."
,
MAL_FORMAT_NOT_SUPPORTED
);
return
mal_post_error
(
pDevice
,
"[ALSA] The chosen format is not supported by mini_al."
,
MAL_FORMAT_NOT_SUPPORTED
);
}
}
// Channels.
// Channels.
mal_uint32
channels
=
pConfig
->
channels
;
mal_uint32
channels
=
pConfig
->
channels
;
if
(((
mal_snd_pcm_hw_params_set_channels_near_proc
)
pContext
->
alsa
.
snd_pcm_hw_params_set_channels_near
)((
mal_snd_pcm_t
*
)
pDevice
->
alsa
.
pPCM
,
pHWParams
,
&
channels
)
<
0
)
{
if
(((
mal_snd_pcm_hw_params_set_channels_near_proc
)
pContext
->
alsa
.
snd_pcm_hw_params_set_channels_near
)((
mal_snd_pcm_t
*
)
pDevice
->
alsa
.
pPCM
,
pHWParams
,
&
channels
)
<
0
)
{
...
...
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