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
27488061
Commit
27488061
authored
Aug 11, 2018
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up.
parent
a6d777f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
46 deletions
+2
-46
mini_al.h
mini_al.h
+2
-46
No files found.
mini_al.h
View file @
27488061
...
...
@@ -6251,10 +6251,6 @@ mal_result mal_device_init__wasapi(mal_context* pContext, mal_device_type type,
pDevice->bufferSizeInFrames = mal_calculate_buffer_size_in_frames_from_milliseconds(pDevice->bufferSizeInMilliseconds, pDevice->internalSampleRate);
}
//if (pDevice->usingDefaultBufferSize) {
// pDevice->bufferSizeInFrames = mal_get_default_buffer_size_in_frames(pConfig->performanceProfile, pConfig->sampleRate);
//}
bufferDurationInMicroseconds = ((mal_uint64)pDevice->bufferSizeInFrames * 1000 * 1000) / pDevice->internalSampleRate;
// Slightly different initialization for shared and exclusive modes. We try exclusive mode first, and if it fails, fall back to shared mode.
...
...
@@ -7517,11 +7513,6 @@ mal_result mal_device_init__dsound(mal_context* pContext, mal_device_type type,
return MAL_FORMAT_NOT_SUPPORTED;
}
//if (pDevice->usingDefaultBufferSize) {
// pDevice->bufferSizeInFrames = mal_get_default_buffer_size_in_frames(pConfig->performanceProfile, pConfig->sampleRate);
//}
WAVEFORMATEXTENSIBLE wf;
mal_zero_object(&wf);
wf.Format.cbSize = sizeof(wf);
...
...
@@ -8566,11 +8557,6 @@ mal_result mal_device_init__winmm(mal_context* pContext, mal_device_type type, c
}
}
//if (pDevice->usingDefaultBufferSize) {
// float bufferSizeScaleFactor = 4;
// pDevice->bufferSizeInFrames = mal_scale_buffer_size(mal_get_default_buffer_size_in_frames(pConfig->performanceProfile, pConfig->sampleRate), bufferSizeScaleFactor);
//}
// The size of the intermediary buffer needs to be able to fit every fragment.
pDevice->winmm.fragmentSizeInFrames = pDevice->bufferSizeInFrames / pDevice->periods;
pDevice->winmm.fragmentSizeInBytes = pDevice->winmm.fragmentSizeInFrames * pDevice->internalChannels * mal_get_bytes_per_sample(pDevice->internalFormat);
...
...
@@ -12007,11 +11993,7 @@ mal_result mal_device_init__pulse(mal_context* pContext, mal_device_type type, c
}
#endif
// If using the default buffer size try to find an appropriate default.
//if (pDevice->usingDefaultBufferSize) {
// bufferSizeInFrames = mal_get_default_buffer_size_in_frames(pConfig->performanceProfile, pConfig->sampleRate);
//}
// Buffer size.
bufferSizeInFrames = pDevice->bufferSizeInFrames;
if (bufferSizeInFrames == 0) {
bufferSizeInFrames = mal_calculate_buffer_size_in_frames_from_milliseconds(pDevice->bufferSizeInMilliseconds, ss.rate);
...
...
@@ -14589,13 +14571,6 @@ mal_result mal_device_init__coreaudio(mal_context* pContext, mal_device_type dev
mal_uint32 actualBufferSizeInFrames = pDevice->bufferSizeInFrames;
#if defined(MAL_APPLE_DESKTOP)
//if (pDevice->usingDefaultBufferSize) {
// actualBufferSizeInFrames = mal_get_default_buffer_size_in_frames(pConfig->performanceProfile, pConfig->sampleRate);
// if (actualBufferSizeInFrames < pDevice->periods) {
// actualBufferSizeInFrames = pDevice->periods;
// }
//}
if (actualBufferSizeInFrames == 0) {
actualBufferSizeInFrames = mal_calculate_buffer_size_in_frames_from_milliseconds(pDevice->bufferSizeInMilliseconds, pDevice->internalSampleRate);
}
...
...
@@ -15412,10 +15387,7 @@ mal_result mal_device_init__sndio(mal_context* pContext, mal_device_type deviceT
if (desiredBufferSizeInFrames == 0) {
desiredBufferSizeInFrames = mal_calculate_buffer_size_in_frames_from_milliseconds(pDevice->bufferSizeInMilliseconds, par.rate);
}
//if (pDevice->usingDefaultBufferSize) {
// desiredBufferSizeInFrames = mal_get_default_buffer_size_in_frames(pConfig->performanceProfile, par.rate);
//}
par.round = desiredBufferSizeInFrames / pDevice->periods;
par.appbufsz = par.round * pDevice->periods;
...
...
@@ -16421,9 +16393,6 @@ mal_result mal_device_init__oss(mal_context* pContext, mal_device_type type, con
if (pDevice->bufferSizeInFrames == 0) {
pDevice->bufferSizeInFrames = mal_calculate_buffer_size_in_frames_from_milliseconds(pDevice->bufferSizeInMilliseconds, pDevice->internalSampleRate);
}
//if (pDevice->usingDefaultBufferSize) {
// pDevice->bufferSizeInFrames = mal_get_default_buffer_size_in_frames(pConfig->performanceProfile, pConfig->sampleRate);
//}
// The documentation says that the fragment settings should be set as soon as possible, but I'm not sure if
// it should be done before or after format/channels/rate.
...
...
@@ -17275,9 +17244,6 @@ mal_result mal_device_init__opensl(mal_context* pContext, mal_device_type type,
if (pDevice->bufferSizeInFrames == 0) {
pDevice->bufferSizeInFrames = mal_calculate_buffer_size_in_frames_from_milliseconds(pDevice->bufferSizeInMilliseconds, pDevice->internalSampleRate);
}
//if (pDevice->usingDefaultBufferSize) {
// pDevice->bufferSizeInFrames = mal_get_default_buffer_size_in_frames(pConfig->performanceProfile, pConfig->sampleRate);
//}
pDevice->opensl.currentBufferIndex = 0;
pDevice->opensl.periodSizeInFrames = pDevice->bufferSizeInFrames / pConfig->periods;
...
...
@@ -17802,11 +17768,6 @@ mal_result mal_device_init__openal(mal_context* pContext, mal_device_type type,
}
}
//if (pDevice->usingDefaultBufferSize) {
// float bufferSizeScaleFactor = 3;
// pDevice->bufferSizeInFrames = mal_scale_buffer_size(mal_get_default_buffer_size_in_frames(pConfig->performanceProfile, pConfig->sampleRate), bufferSizeScaleFactor);
//}
mal_ALCsizei bufferSizeInSamplesAL = pDevice->bufferSizeInFrames;
mal_ALCuint frequencyAL = pConfig->sampleRate;
...
...
@@ -18721,11 +18682,6 @@ mal_result mal_device_init__sdl(mal_context* pContext, mal_device_type type, con
(void)pContext;
//mal_uint32 bufferSize = pConfig->bufferSizeInFrames;
//if (pDevice->usingDefaultBufferSize) {
// bufferSize = mal_get_default_buffer_size_in_frames(pConfig->performanceProfile, pConfig->sampleRate);
//}
if (pDevice->bufferSizeInFrames == 0) {
pDevice->bufferSizeInFrames = mal_calculate_buffer_size_in_frames_from_milliseconds(pDevice->bufferSizeInMilliseconds, pDevice->sampleRate);
}
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