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
6cba1592
Commit
6cba1592
authored
Nov 29, 2023
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ALSA: Fix some warnings relating to unhandled return value of `read()`.
parent
15833291
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
11 deletions
+19
-11
CHANGES.md
CHANGES.md
+1
-0
miniaudio.h
miniaudio.h
+18
-11
No files found.
CHANGES.md
View file @
6cba1592
v0.11.22 - TBD
v0.11.22 - TBD
=====================
=====================
*
ALSA: Fix some warnings relating to unhandled return value of
`read()`
.
*
DirectSound: Add support for specifying an explicit window handle for SetCooperativeLevel().
*
DirectSound: Add support for specifying an explicit window handle for SetCooperativeLevel().
...
...
miniaudio.h
View file @
6cba1592
...
@@ -28073,6 +28073,7 @@ static ma_result ma_device_stop__alsa(ma_device* pDevice)
...
@@ -28073,6 +28073,7 @@ static ma_result ma_device_stop__alsa(ma_device* pDevice)
a small chance that our wakeupfd has not been cleared. We'll clear that out now if applicable.
a small chance that our wakeupfd has not been cleared. We'll clear that out now if applicable.
*/
*/
int resultPoll;
int resultPoll;
int resultRead;
if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) {
if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex) {
ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_DEBUG, "[ALSA] Dropping capture device...\n");
ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_DEBUG, "[ALSA] Dropping capture device...\n");
...
@@ -28091,7 +28092,10 @@ static ma_result ma_device_stop__alsa(ma_device* pDevice)
...
@@ -28091,7 +28092,10 @@ static ma_result ma_device_stop__alsa(ma_device* pDevice)
resultPoll = poll((struct pollfd*)pDevice->alsa.pPollDescriptorsCapture, 1, 0);
resultPoll = poll((struct pollfd*)pDevice->alsa.pPollDescriptorsCapture, 1, 0);
if (resultPoll > 0) {
if (resultPoll > 0) {
ma_uint64 t;
ma_uint64 t;
read(((struct pollfd*)pDevice->alsa.pPollDescriptorsCapture)[0].fd, &t, sizeof(t));
resultRead = read(((struct pollfd*)pDevice->alsa.pPollDescriptorsCapture)[0].fd, &t, sizeof(t));
if (resultRead != sizeof(t)) {
ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_DEBUG, "[ALSA] Failed to read from capture wakeupfd. read() = %d\n", resultRead);
}
}
}
}
}
...
@@ -28112,7 +28116,10 @@ static ma_result ma_device_stop__alsa(ma_device* pDevice)
...
@@ -28112,7 +28116,10 @@ static ma_result ma_device_stop__alsa(ma_device* pDevice)
resultPoll = poll((struct pollfd*)pDevice->alsa.pPollDescriptorsPlayback, 1, 0);
resultPoll = poll((struct pollfd*)pDevice->alsa.pPollDescriptorsPlayback, 1, 0);
if (resultPoll > 0) {
if (resultPoll > 0) {
ma_uint64 t;
ma_uint64 t;
read(((struct pollfd*)pDevice->alsa.pPollDescriptorsPlayback)[0].fd, &t, sizeof(t));
resultRead = read(((struct pollfd*)pDevice->alsa.pPollDescriptorsPlayback)[0].fd, &t, sizeof(t));
if (resultRead != sizeof(t)) {
ma_log_postf(ma_device_get_log(pDevice), MA_LOG_LEVEL_DEBUG, "[ALSA] Failed to read from playback wakeupfd. read() = %d\n", resultRead);
}
}
}
}
}
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