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
2866bc2b
Commit
2866bc2b
authored
Mar 06, 2019
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix build with MAL_NO_DEVICE_IO.
parent
7ad511a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
18 deletions
+18
-18
mini_al.h
mini_al.h
+15
-15
tests/mal_no_device_io.c
tests/mal_no_device_io.c
+3
-3
No files found.
mini_al.h
View file @
2866bc2b
...
...
@@ -3953,6 +3953,21 @@ mal_uint32 mal_get_standard_sample_rate_priority_index(mal_uint32 sampleRate)
return (mal_uint32)-1;
}
mal_uint64 mal_calculate_frame_count_after_src(mal_uint32 sampleRateOut, mal_uint32 sampleRateIn, mal_uint64 frameCountIn)
{
double srcRatio = (double)sampleRateOut / sampleRateIn;
double frameCountOutF = frameCountIn * srcRatio;
mal_uint64 frameCountOut = (mal_uint64)frameCountOutF;
// If the output frame count is fractional, make sure we add an extra frame to ensure there's enough room for that last sample.
if ((frameCountOutF - frameCountOut) > 0.0) {
frameCountOut += 1;
}
return frameCountOut;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
...
...
@@ -4807,21 +4822,6 @@ mal_result mal_post_error(mal_device* pDevice, mal_uint32 logLevel, const char*
}
mal_uint64 mal_calculate_frame_count_after_src(mal_uint32 sampleRateOut, mal_uint32 sampleRateIn, mal_uint64 frameCountIn)
{
double srcRatio = (double)sampleRateOut / sampleRateIn;
double frameCountOutF = frameCountIn * srcRatio;
mal_uint64 frameCountOut = (mal_uint64)frameCountOutF;
// If the output frame count is fractional, make sure we add an extra frame to ensure there's enough room for that last sample.
if ((frameCountOutF - frameCountOut) > 0.0) {
frameCountOut += 1;
}
return frameCountOut;
}
// The callback for reading from the client -> DSP -> device.
mal_uint32 mal_device__on_read_from_client(mal_pcm_converter* pDSP, void* pFramesOut, mal_uint32 frameCount, void* pUserData)
tests/mal_no_device_io.c
View file @
2866bc2b
...
...
@@ -15,9 +15,9 @@ int main(int argc, char** argv)
mal_result
result
=
MAL_ERROR
;
mal_
dsp_config
dspConfig
=
mal_dsp
_config_init_new
();
mal_
dsp
dsp
;
result
=
mal_
dsp_init
(
&
dspConfig
,
&
dsp
);
mal_
pcm_converter_config
dspConfig
=
mal_pcm_converter
_config_init_new
();
mal_
pcm_converter
converter
;
result
=
mal_
pcm_converter_init
(
&
dspConfig
,
&
converter
);
mal_decoder_config
decoderConfig
=
mal_decoder_config_init
(
mal_format_unknown
,
0
,
0
);
mal_decoder
decoder
;
...
...
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