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
f7a825d9
Commit
f7a825d9
authored
Oct 18, 2016
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix build for the DirectSound backend.
parent
bf67d5a3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
15 deletions
+21
-15
mini_al.h
mini_al.h
+21
-15
No files found.
mini_al.h
View file @
f7a825d9
...
@@ -1039,7 +1039,7 @@ static BOOL CALLBACK mal_enum_devices_callback__dsound(LPGUID lpGuid, LPCSTR lpc
...
@@ -1039,7 +1039,7 @@ static BOOL CALLBACK mal_enum_devices_callback__dsound(LPGUID lpGuid, LPCSTR lpc
if
(
pData
->
pInfo
!=
NULL
)
{
if
(
pData
->
pInfo
!=
NULL
)
{
if
(
pData
->
infoCount
>
0
)
{
if
(
pData
->
infoCount
>
0
)
{
mal_zero_object
(
pData
->
pInfo
);
mal_zero_object
(
pData
->
pInfo
);
mal_strncpy_s
(
pData
->
pInfo
->
description
,
sizeof
(
pData
->
pInfo
->
description
),
lpcstrDescription
,
(
size_t
)
-
1
);
mal_strncpy_s
(
pData
->
pInfo
->
name
,
sizeof
(
pData
->
pInfo
->
name
),
lpcstrDescription
,
(
size_t
)
-
1
);
if
(
lpGuid
!=
NULL
)
{
if
(
lpGuid
!=
NULL
)
{
mal_copy_memory
(
pData
->
pInfo
->
id
.
guid
,
lpGuid
,
16
);
mal_copy_memory
(
pData
->
pInfo
->
id
.
guid
,
lpGuid
,
16
);
...
@@ -2083,6 +2083,25 @@ mal_result mal_device_init__alsa(mal_device* pDevice, mal_device_type type, mal_
...
@@ -2083,6 +2083,25 @@ mal_result mal_device_init__alsa(mal_device* pDevice, mal_device_type type, mal_
return
mal_post_error
(
pDevice
,
"[ALSA] Failed to initialize hardware parameters. snd_pcm_hw_params_any() failed."
,
MAL_ALSA_FAILED_TO_SET_HW_PARAMS
);
return
mal_post_error
(
pDevice
,
"[ALSA] Failed to initialize hardware parameters. snd_pcm_hw_params_any() failed."
,
MAL_ALSA_FAILED_TO_SET_HW_PARAMS
);
}
}
// Most important properties first.
if
(
snd_pcm_hw_params_set_rate_near
((
snd_pcm_t
*
)
pDevice
->
alsa
.
pPCM
,
pHWParams
,
&
sampleRate
,
0
)
<
0
)
{
mal_device_uninit__alsa
(
pDevice
);
return
mal_post_error
(
pDevice
,
"[ALSA] Sample rate not supported. snd_pcm_hw_params_set_rate_near() failed."
,
MAL_FORMAT_NOT_SUPPORTED
);
}
if
(
snd_pcm_hw_params_set_channels_near
((
snd_pcm_t
*
)
pDevice
->
alsa
.
pPCM
,
pHWParams
,
&
channels
)
<
0
)
{
mal_device_uninit__alsa
(
pDevice
);
return
mal_post_error
(
pDevice
,
"[ALSA] Failed to set channel count. snd_pcm_hw_params_set_channels_near() failed."
,
MAL_FORMAT_NOT_SUPPORTED
);
}
if
(
snd_pcm_hw_params_set_format
((
snd_pcm_t
*
)
pDevice
->
alsa
.
pPCM
,
pHWParams
,
formatALSA
)
<
0
)
{
mal_device_uninit__alsa
(
pDevice
);
return
mal_post_error
(
pDevice
,
"[ALSA] Format not supported. snd_pcm_hw_params_set_format() failed."
,
MAL_FORMAT_NOT_SUPPORTED
);
}
// Try using interleaved MMAP access. If this fails, fall back to standard readi/writei.
// Try using interleaved MMAP access. If this fails, fall back to standard readi/writei.
pDevice
->
alsa
.
isUsingMMap
=
MAL_FALSE
;
pDevice
->
alsa
.
isUsingMMap
=
MAL_FALSE
;
#ifdef MAL_ENABLE_EXPERIMENTAL_ALSA_MMAP
#ifdef MAL_ENABLE_EXPERIMENTAL_ALSA_MMAP
...
@@ -2099,21 +2118,8 @@ mal_result mal_device_init__alsa(mal_device* pDevice, mal_device_type type, mal_
...
@@ -2099,21 +2118,8 @@ mal_result mal_device_init__alsa(mal_device* pDevice, mal_device_type type, mal_
}
}
}
}
if
(
snd_pcm_hw_params_set_format
((
snd_pcm_t
*
)
pDevice
->
alsa
.
pPCM
,
pHWParams
,
formatALSA
)
<
0
)
{
mal_device_uninit__alsa
(
pDevice
);
return
mal_post_error
(
pDevice
,
"[ALSA] Format not supported. snd_pcm_hw_params_set_format() failed."
,
MAL_FORMAT_NOT_SUPPORTED
);
}
if
(
snd_pcm_hw_params_set_rate_near
((
snd_pcm_t
*
)
pDevice
->
alsa
.
pPCM
,
pHWParams
,
&
sampleRate
,
0
)
<
0
)
{
mal_device_uninit__alsa
(
pDevice
);
return
mal_post_error
(
pDevice
,
"[ALSA] Sample rate not supported. snd_pcm_hw_params_set_rate_near() failed."
,
MAL_FORMAT_NOT_SUPPORTED
);
}
if
(
snd_pcm_hw_params_set_channels_near
((
snd_pcm_t
*
)
pDevice
->
alsa
.
pPCM
,
pHWParams
,
&
channels
)
<
0
)
{
mal_device_uninit__alsa
(
pDevice
);
return
mal_post_error
(
pDevice
,
"[ALSA] Failed to set channel count. snd_pcm_hw_params_set_channels_near() failed."
,
MAL_FORMAT_NOT_SUPPORTED
);
}
int
dir
=
1
;
int
dir
=
1
;
if
(
snd_pcm_hw_params_set_periods_near
((
snd_pcm_t
*
)
pDevice
->
alsa
.
pPCM
,
pHWParams
,
&
fragmentCount
,
&
dir
)
<
0
)
{
if
(
snd_pcm_hw_params_set_periods_near
((
snd_pcm_t
*
)
pDevice
->
alsa
.
pPCM
,
pHWParams
,
&
fragmentCount
,
&
dir
)
<
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