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
9d007e9f
"include/svn:/svn.code.sf.net/p/irrlicht/code/trunk@3063" did not exist on "a0b9cea740120a973a674a0eea4e04022face9f5"
Commit
9d007e9f
authored
Oct 16, 2016
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use snd_pcm_hw/sw_params_alloca() instead of *malloc()
parent
0e927cf7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
13 deletions
+3
-13
mini_al.h
mini_al.h
+3
-13
No files found.
mini_al.h
View file @
9d007e9f
...
...
@@ -1791,10 +1791,7 @@ mal_result mal_device_init__alsa(mal_device* pDevice, mal_device_type type, mal_
}
snd_pcm_hw_params_t
*
pHWParams
=
NULL
;
if
(
snd_pcm_hw_params_malloc
(
&
pHWParams
)
<
0
)
{
mal_device_uninit__alsa
(
pDevice
);
return
mal_post_error
(
pDevice
,
"[ALSA] Failed to allocate snd_pcm_hw_params_t."
,
MAL_OUT_OF_MEMORY
);
}
snd_pcm_hw_params_alloca
(
&
pHWParams
);
if
(
snd_pcm_hw_params_any
((
snd_pcm_t
*
)
pDevice
->
alsa
.
pPCM
,
pHWParams
)
<
0
)
{
snd_pcm_hw_params_free
(
pHWParams
);
...
...
@@ -1856,15 +1853,10 @@ mal_result mal_device_init__alsa(mal_device* pDevice, mal_device_type type, mal_
return
mal_post_error
(
pDevice
,
"[ALSA] Failed to set hardware parameters. snd_pcm_hw_params() failed."
,
MAL_ALSA_FAILED_TO_SET_SW_PARAMS
);
}
snd_pcm_hw_params_free
(
pHWParams
);
snd_pcm_sw_params_t
*
pSWParams
=
NULL
;
if
(
snd_pcm_sw_params_malloc
(
&
pSWParams
)
<
0
)
{
mal_device_uninit__alsa
(
pDevice
);
return
mal_post_error
(
pDevice
,
"[ALSA] Failed to allocate software parameters. snd_pcm_dw_params_malloc() failed."
,
MAL_OUT_OF_MEMORY
);
}
snd_pcm_sw_params_alloca
(
&
pSWParams
);
if
(
snd_pcm_sw_params_current
((
snd_pcm_t
*
)
pDevice
->
alsa
.
pPCM
,
pSWParams
)
!=
0
)
{
snd_pcm_sw_params_free
(
pSWParams
);
...
...
@@ -1892,8 +1884,6 @@ mal_result mal_device_init__alsa(mal_device* pDevice, mal_device_type type, mal_
return
mal_post_error
(
pDevice
,
"[ALSA] Failed to set software parameters. snd_pcm_sw_params() failed."
,
MAL_ALSA_FAILED_TO_SET_SW_PARAMS
);
}
snd_pcm_sw_params_free
(
pSWParams
);
// If we're _not_ using mmap we need to use an intermediary buffer.
...
...
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