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
369d3b8d
Commit
369d3b8d
authored
Jul 31, 2021
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compilation errors with examples.
parent
d371f355
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
6 deletions
+8
-6
examples/custom_backend.c
examples/custom_backend.c
+5
-3
examples/fixed_size_callback.c
examples/fixed_size_callback.c
+1
-1
examples/simple_capture.c
examples/simple_capture.c
+1
-1
examples/simple_playback_sine.c
examples/simple_playback_sine.c
+1
-1
No files found.
examples/custom_backend.c
View file @
369d3b8d
...
...
@@ -295,7 +295,8 @@ static ma_result ma_context_get_device_info__sdl(ma_context* pContext, ma_device
tempDeviceID
=
((
MA_PFN_SDL_OpenAudioDevice
)
pContextEx
->
sdl
.
SDL_OpenAudioDevice
)(
pDeviceName
,
(
deviceType
==
ma_device_type_playback
)
?
0
:
1
,
&
desiredSpec
,
&
obtainedSpec
,
MA_SDL_AUDIO_ALLOW_ANY_CHANGE
);
if
(
tempDeviceID
==
0
)
{
return
ma_context_post_error
(
pContext
,
NULL
,
MA_LOG_LEVEL_ERROR
,
"Failed to open SDL device."
,
MA_FAILED_TO_OPEN_BACKEND_DEVICE
);
ma_log_postf
(
ma_context_get_log
(
pContext
),
MA_LOG_LEVEL_ERROR
,
"Failed to open SDL device."
);
return
MA_FAILED_TO_OPEN_BACKEND_DEVICE
;
}
((
MA_PFN_SDL_CloseAudioDevice
)
pContextEx
->
sdl
.
SDL_CloseAudioDevice
)(
tempDeviceID
);
...
...
@@ -402,7 +403,8 @@ static ma_result ma_device_init_internal__sdl(ma_device_ex* pDeviceEx, const ma_
deviceID
=
((
MA_PFN_SDL_OpenAudioDevice
)
pContextEx
->
sdl
.
SDL_OpenAudioDevice
)(
pDeviceName
,
(
pConfig
->
deviceType
==
ma_device_type_playback
)
?
0
:
1
,
&
desiredSpec
,
&
obtainedSpec
,
MA_SDL_AUDIO_ALLOW_ANY_CHANGE
);
if
(
deviceID
==
0
)
{
return
ma_post_error
((
ma_device
*
)
pDeviceEx
,
MA_LOG_LEVEL_ERROR
,
"Failed to open SDL2 device."
,
MA_FAILED_TO_OPEN_BACKEND_DEVICE
);
ma_log_postf
(
ma_device_get_log
((
ma_device
*
)
pDeviceEx
),
MA_LOG_LEVEL_ERROR
,
"Failed to open SDL2 device."
);
return
MA_FAILED_TO_OPEN_BACKEND_DEVICE
;
}
if
(
pConfig
->
deviceType
==
ma_device_type_playback
)
{
...
...
@@ -647,7 +649,7 @@ void data_callback(ma_device* pDevice, void* pOutput, const void* pInput, ma_uin
pSineWave
=
(
ma_waveform
*
)
pDevice
->
pUserData
;
MA_ASSERT
(
pSineWave
!=
NULL
);
ma_waveform_read_pcm_frames
(
pSineWave
,
pOutput
,
frameCount
);
ma_waveform_read_pcm_frames
(
pSineWave
,
pOutput
,
frameCount
,
NULL
);
}
if
(
pDevice
->
type
==
ma_device_type_duplex
)
{
...
...
examples/fixed_size_callback.c
View file @
369d3b8d
...
...
@@ -35,7 +35,7 @@ void data_callback_fixed(ma_device* pDevice, void* pOutput, const void* pInput,
*/
printf
(
"frameCount=%d
\n
"
,
frameCount
);
ma_waveform_read_pcm_frames
(
&
g_sineWave
,
pOutput
,
frameCount
);
ma_waveform_read_pcm_frames
(
&
g_sineWave
,
pOutput
,
frameCount
,
NULL
);
/* Unused in this example. */
(
void
)
pDevice
;
...
...
examples/simple_capture.c
View file @
369d3b8d
...
...
@@ -19,7 +19,7 @@ void data_callback(ma_device* pDevice, void* pOutput, const void* pInput, ma_uin
ma_encoder
*
pEncoder
=
(
ma_encoder
*
)
pDevice
->
pUserData
;
MA_ASSERT
(
pEncoder
!=
NULL
);
ma_encoder_write_pcm_frames
(
pEncoder
,
pInput
,
frameCount
);
ma_encoder_write_pcm_frames
(
pEncoder
,
pInput
,
frameCount
,
NULL
);
(
void
)
pOutput
;
}
...
...
examples/simple_playback_sine.c
View file @
369d3b8d
...
...
@@ -40,7 +40,7 @@ void data_callback(ma_device* pDevice, void* pOutput, const void* pInput, ma_uin
pSineWave
=
(
ma_waveform
*
)
pDevice
->
pUserData
;
MA_ASSERT
(
pSineWave
!=
NULL
);
ma_waveform_read_pcm_frames
(
pSineWave
,
pOutput
,
frameCount
);
ma_waveform_read_pcm_frames
(
pSineWave
,
pOutput
,
frameCount
,
NULL
);
(
void
)
pInput
;
/* Unused. */
}
...
...
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