mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-21 15:56:58 +02:00
ALSA: Fix some warnings relating to unhandled return value of read().
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
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().
|
||||
|
||||
|
||||
|
||||
+9
-2
@@ -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.
|
||||
*/
|
||||
int resultPoll;
|
||||
int resultRead;
|
||||
|
||||
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");
|
||||
@@ -28091,7 +28092,10 @@ static ma_result ma_device_stop__alsa(ma_device* pDevice)
|
||||
resultPoll = poll((struct pollfd*)pDevice->alsa.pPollDescriptorsCapture, 1, 0);
|
||||
if (resultPoll > 0) {
|
||||
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)
|
||||
resultPoll = poll((struct pollfd*)pDevice->alsa.pPollDescriptorsPlayback, 1, 0);
|
||||
if (resultPoll > 0) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user