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
1574c56c
Commit
1574c56c
authored
Sep 26, 2018
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a bug with the SDL backend.
parent
70af5378
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
mini_al.h
mini_al.h
+11
-6
No files found.
mini_al.h
View file @
1574c56c
// Audio playback and capture library. Public domain. See "unlicense" statement at the end of this file.
// Audio playback and capture library. Public domain. See "unlicense" statement at the end of this file.
// mini_al - v0.8.
8 - 2018-09-14
// mini_al - v0.8.
9-rc - 2018-09-xx
//
//
// David Reid - davidreidsoftware@gmail.com
// David Reid - davidreidsoftware@gmail.com
...
@@ -19725,7 +19725,7 @@ mal_result mal_device_init__sdl(mal_context* pContext, mal_device_type type, con
...
@@ -19725,7 +19725,7 @@ mal_result mal_device_init__sdl(mal_context* pContext, mal_device_type type, con
// SDL wants the buffer size to be a power of 2. The SDL_AudioSpec property for this is only a Uint16, so we need
// SDL wants the buffer size to be a power of 2. The SDL_AudioSpec property for this is only a Uint16, so we need
// to explicitly clamp this because it will be easy to overflow.
// to explicitly clamp this because it will be easy to overflow.
mal_uint32 bufferSize = p
Config
->bufferSizeInFrames;
mal_uint32 bufferSize = p
Device
->bufferSizeInFrames;
if (bufferSize > 32768) {
if (bufferSize > 32768) {
bufferSize = 32768;
bufferSize = 32768;
} else {
} else {
...
@@ -19760,7 +19760,7 @@ mal_result mal_device_init__sdl(mal_context* pContext, mal_device_type type, con
...
@@ -19760,7 +19760,7 @@ mal_result mal_device_init__sdl(mal_context* pContext, mal_device_type type, con
pDevice->sdl.deviceID = ((MAL_PFN_SDL_OpenAudioDevice)pDevice->pContext->sdl.SDL_OpenAudioDevice)(pDeviceName, isCapture, &desiredSpec, &obtainedSpec, MAL_SDL_AUDIO_ALLOW_ANY_CHANGE);
pDevice->sdl.deviceID = ((MAL_PFN_SDL_OpenAudioDevice)pDevice->pContext->sdl.SDL_OpenAudioDevice)(pDeviceName, isCapture, &desiredSpec, &obtainedSpec, MAL_SDL_AUDIO_ALLOW_ANY_CHANGE);
if (pDevice->sdl.deviceID == 0) {
if (pDevice->sdl.deviceID == 0) {
return mal_post_error(pDevice, MAL_LOG_LEVEL_ERROR, "Failed to open SDL device.", MAL_FAILED_TO_OPEN_BACKEND_DEVICE);
return mal_post_error(pDevice, MAL_LOG_LEVEL_ERROR, "Failed to open SDL
2
device.", MAL_FAILED_TO_OPEN_BACKEND_DEVICE);
}
}
} else
} else
#endif
#endif
...
@@ -19778,10 +19778,12 @@ mal_result mal_device_init__sdl(mal_context* pContext, mal_device_type type, con
...
@@ -19778,10 +19778,12 @@ mal_result mal_device_init__sdl(mal_context* pContext, mal_device_type type, con
desiredSpec.format = MAL_AUDIO_S16;
desiredSpec.format = MAL_AUDIO_S16;
}
}
pDevice->sdl.
deviceID = ((MAL_PFN_SDL_OpenAudio)pDevice->pContext->sdl.SDL_OpenAudio)(&desiredSpec, &obtainedSpec);
int
deviceID = ((MAL_PFN_SDL_OpenAudio)pDevice->pContext->sdl.SDL_OpenAudio)(&desiredSpec, &obtainedSpec);
if (
pDevice->sdl.deviceID !=
0) {
if (
deviceID <
0) {
return mal_post_error(pDevice, MAL_LOG_LEVEL_ERROR, "Failed to open SDL device.", MAL_FAILED_TO_OPEN_BACKEND_DEVICE);
return mal_post_error(pDevice, MAL_LOG_LEVEL_ERROR, "Failed to open SDL
1
device.", MAL_FAILED_TO_OPEN_BACKEND_DEVICE);
}
}
pDevice->sdl.deviceID = (mal_uint32)deviceID;
}
}
pDevice->internalFormat = mal_format_from_sdl(obtainedSpec.format);
pDevice->internalFormat = mal_format_from_sdl(obtainedSpec.format);
...
@@ -28296,6 +28298,9 @@ mal_uint64 mal_sine_wave_read_ex(mal_sine_wave* pSineWave, mal_uint64 frameCount
...
@@ -28296,6 +28298,9 @@ mal_uint64 mal_sine_wave_read_ex(mal_sine_wave* pSineWave, mal_uint64 frameCount
// REVISION HISTORY
// REVISION HISTORY
// ================
// ================
//
//
// v0.8.9-rc - 2018-09-xx
// - Fix SDL backend.
//
// v0.8.8 - 2018-09-14
// v0.8.8 - 2018-09-14
// - Fix Linux build with the ALSA backend.
// - Fix Linux build with the ALSA backend.
// - Minor documentation fix.
// - Minor documentation fix.
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