diff options
author | liamwhite <[email protected]> | 2024-02-23 11:34:21 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2024-02-23 11:34:21 -0500 |
commit | 215e887be088ed572da999e9ec7fd8559198524b (patch) | |
tree | 793415b72d36bb07d0174dfcf731f81235008936 /src/audio_core/renderer/audio_device.cpp | |
parent | 0da6704fc2e45958ee2bf884128ce0ff5897ac1a (diff) | |
parent | 964e19ab56385117ee77b12311eb4a959e3abf4a (diff) | |
download | yuzu-android-215e887be088ed572da999e9ec7fd8559198524b.tar.gz yuzu-android-215e887be088ed572da999e9ec7fd8559198524b.zip |
Merge pull request #13100 from liamwhite/audio-ipc
audio: move to new ipc
Diffstat (limited to 'src/audio_core/renderer/audio_device.cpp')
-rw-r--r-- | src/audio_core/renderer/audio_device.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/audio_core/renderer/audio_device.cpp b/src/audio_core/renderer/audio_device.cpp index 2d9bf82bb..5be5594f6 100644 --- a/src/audio_core/renderer/audio_device.cpp +++ b/src/audio_core/renderer/audio_device.cpp @@ -36,8 +36,7 @@ AudioDevice::AudioDevice(Core::System& system, const u64 applet_resource_user_id : output_sink{system.AudioCore().GetOutputSink()}, applet_resource_user_id{applet_resource_user_id_}, user_revision{revision} {} -u32 AudioDevice::ListAudioDeviceName(std::vector<AudioDeviceName>& out_buffer, - const size_t max_count) const { +u32 AudioDevice::ListAudioDeviceName(std::span<AudioDeviceName> out_buffer) const { std::span<const AudioDeviceName> names{}; if (CheckFeatureSupported(SupportTags::AudioUsbDeviceOutput, user_revision)) { @@ -46,19 +45,18 @@ u32 AudioDevice::ListAudioDeviceName(std::vector<AudioDeviceName>& out_buffer, names = device_names; } - const u32 out_count{static_cast<u32>(std::min(max_count, names.size()))}; + const u32 out_count{static_cast<u32>(std::min(out_buffer.size(), names.size()))}; for (u32 i = 0; i < out_count; i++) { - out_buffer.push_back(names[i]); + out_buffer[i] = names[i]; } return out_count; } -u32 AudioDevice::ListAudioOutputDeviceName(std::vector<AudioDeviceName>& out_buffer, - const size_t max_count) const { - const u32 out_count{static_cast<u32>(std::min(max_count, output_device_names.size()))}; +u32 AudioDevice::ListAudioOutputDeviceName(std::span<AudioDeviceName> out_buffer) const { + const u32 out_count{static_cast<u32>(std::min(out_buffer.size(), output_device_names.size()))}; for (u32 i = 0; i < out_count; i++) { - out_buffer.push_back(output_device_names[i]); + out_buffer[i] = output_device_names[i]; } return out_count; } |