From 23c3277754b366e35f31bf226c65f36d8e4ef79b Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 3 Jan 2026 13:39:38 +1000 Subject: [PATCH] OSS: Remove some redundant device status checks. --- miniaudio.h | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/miniaudio.h b/miniaudio.h index b186b459..73172c51 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -39755,18 +39755,11 @@ static ma_result ma_device_write__oss(ma_device* pDevice, const void* pPCMFrames { ma_device_state_oss* pDeviceStateOSS = ma_device_get_backend_state__oss(pDevice); int resultOSS; - ma_uint32 deviceState; if (pFramesWritten != NULL) { *pFramesWritten = 0; } - /* Don't do any processing if the device is stopped. */ - deviceState = ma_device_get_status(pDevice); - if (deviceState != ma_device_status_started && deviceState != ma_device_status_starting) { - return MA_SUCCESS; - } - resultOSS = write(pDeviceStateOSS->fdPlayback, pPCMFrames, frameCount * ma_get_bytes_per_frame(pDevice->playback.internalFormat, pDevice->playback.internalChannels)); if (resultOSS < 0) { ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[OSS] Failed to send data from the client to the device."); @@ -39784,18 +39777,11 @@ static ma_result ma_device_read__oss(ma_device* pDevice, void* pPCMFrames, ma_ui { ma_device_state_oss* pDeviceStateOSS = ma_device_get_backend_state__oss(pDevice); int resultOSS; - ma_uint32 deviceState; if (pFramesRead != NULL) { *pFramesRead = 0; } - /* Don't do any processing if the device is stopped. */ - deviceState = ma_device_get_status(pDevice); - if (deviceState != ma_device_status_started && deviceState != ma_device_status_starting) { - return MA_SUCCESS; - } - resultOSS = read(pDeviceStateOSS->fdCapture, pPCMFrames, frameCount * ma_get_bytes_per_frame(pDevice->capture.internalFormat, pDevice->capture.internalChannels)); if (resultOSS < 0) { ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[OSS] Failed to read data from the device to be sent to the client.");