summaryrefslogtreecommitdiffstats
path: root/src/audio_core
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2024-02-20 03:45:48 +0100
committerLiam <byteslice@airmail.cc>2024-02-21 04:15:37 +0100
commit2a2c92f1819f44a86f452654398d0fc16806c438 (patch)
tree32607c7d8bbb0232fd496bf8e621e29a3abd0fcb /src/audio_core
parentaudio: rewrite IAudioIn (diff)
downloadyuzu-2a2c92f1819f44a86f452654398d0fc16806c438.tar
yuzu-2a2c92f1819f44a86f452654398d0fc16806c438.tar.gz
yuzu-2a2c92f1819f44a86f452654398d0fc16806c438.tar.bz2
yuzu-2a2c92f1819f44a86f452654398d0fc16806c438.tar.lz
yuzu-2a2c92f1819f44a86f452654398d0fc16806c438.tar.xz
yuzu-2a2c92f1819f44a86f452654398d0fc16806c438.tar.zst
yuzu-2a2c92f1819f44a86f452654398d0fc16806c438.zip
Diffstat (limited to 'src/audio_core')
-rw-r--r--src/audio_core/audio_in_manager.cpp7
-rw-r--r--src/audio_core/audio_in_manager.h4
2 files changed, 4 insertions, 7 deletions
diff --git a/src/audio_core/audio_in_manager.cpp b/src/audio_core/audio_in_manager.cpp
index a3667524f..63b064922 100644
--- a/src/audio_core/audio_in_manager.cpp
+++ b/src/audio_core/audio_in_manager.cpp
@@ -73,16 +73,15 @@ void Manager::BufferReleaseAndRegister() {
}
}
-u32 Manager::GetDeviceNames(std::vector<Renderer::AudioDevice::AudioDeviceName>& names,
- [[maybe_unused]] const u32 max_count,
+u32 Manager::GetDeviceNames(std::span<Renderer::AudioDevice::AudioDeviceName> names,
[[maybe_unused]] const bool filter) {
std::scoped_lock l{mutex};
LinkToManager();
auto input_devices{Sink::GetDeviceListForSink(Settings::values.sink_id.GetValue(), true)};
- if (input_devices.size() > 1) {
- names.emplace_back("Uac");
+ if (!input_devices.empty() && !names.empty()) {
+ names[0] = Renderer::AudioDevice::AudioDeviceName("Uac");
return 1;
}
return 0;
diff --git a/src/audio_core/audio_in_manager.h b/src/audio_core/audio_in_manager.h
index 5c4614cd1..2179990e0 100644
--- a/src/audio_core/audio_in_manager.h
+++ b/src/audio_core/audio_in_manager.h
@@ -60,13 +60,11 @@ public:
* Get a list of audio in device names.
*
* @param names - Output container to write names to.
- * @param max_count - Maximum number of device names to write. Unused
* @param filter - Should the list be filtered? Unused.
*
* @return Number of names written.
*/
- u32 GetDeviceNames(std::vector<Renderer::AudioDevice::AudioDeviceName>& names, u32 max_count,
- bool filter);
+ u32 GetDeviceNames(std::span<Renderer::AudioDevice::AudioDeviceName> names, bool filter);
/// Core system
Core::System& system;