From fc45d8ca0658a3d6b096071a29c9be967b4848c2 Mon Sep 17 00:00:00 2001 From: Matthieu Bouron Date: Tue, 4 Jun 2024 11:44:32 +0200 Subject: [PATCH] AAudio: Fix ma_device_get_info() implementation --- CHANGES.md | 1 + miniaudio.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 36cb09a5..eeccca75 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,6 +10,7 @@ v0.11.22 - TBD * Web: Fix an error with the unlocked notification when compiling as C++. * Web: Fix a JavaScript error when initializing and then uninitializing a context before any interactivity. * AAudio: The default minimum SDK version has been increased from 26 to 27 when enabling AAudio. If you need to support version 26, you can use `#define MA_AAUDIO_MIN_ANDROID_SDK_VERSION 26`. +* AAudio: Fix ma_device_get_info() implementation v0.11.21 - 2023-11-15 diff --git a/miniaudio.h b/miniaudio.h index ad2a7bf7..4bdb76aa 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -38357,12 +38357,12 @@ static ma_result ma_device_get_info__aaudio(ma_device* pDevice, ma_device_type t MA_ASSERT(type != ma_device_type_duplex); MA_ASSERT(pDeviceInfo != NULL); - if (type == ma_device_type_playback) { + if (type == ma_device_type_capture) { pStream = (ma_AAudioStream*)pDevice->aaudio.pStreamCapture; pDeviceInfo->id.aaudio = pDevice->capture.id.aaudio; ma_strncpy_s(pDeviceInfo->name, sizeof(pDeviceInfo->name), MA_DEFAULT_CAPTURE_DEVICE_NAME, (size_t)-1); /* Only supporting default devices. */ } - if (type == ma_device_type_capture) { + if (type == ma_device_type_playback) { pStream = (ma_AAudioStream*)pDevice->aaudio.pStreamPlayback; pDeviceInfo->id.aaudio = pDevice->playback.id.aaudio; ma_strncpy_s(pDeviceInfo->name, sizeof(pDeviceInfo->name), MA_DEFAULT_PLAYBACK_DEVICE_NAME, (size_t)-1); /* Only supporting default devices. */