early-access version 3703

This commit is contained in:
pineappleEA
2023-06-22 16:59:02 +02:00
parent 7d5a10eb6b
commit 5a71a5c0bf
10 changed files with 30 additions and 71 deletions

View File

@@ -7,7 +7,7 @@
#include <mutex>
#include <span>
#include <vector>
#include <boost/container/small_vector.hpp>
#include <boost/container/static_vector.hpp>
#include "audio_buffer.h"
#include "audio_core/device/device_session.h"
@@ -49,7 +49,7 @@ public:
*
* @param out_buffers - The buffers which were registered.
*/
void RegisterBuffers(boost::container::small_vector<AudioBuffer, N>& out_buffers) {
void RegisterBuffers(boost::container::static_vector<AudioBuffer, N>& out_buffers) {
std::scoped_lock l{lock};
const s32 to_register{std::min(std::min(appended_count, BufferAppendLimit),
BufferAppendLimit - registered_count)};
@@ -164,7 +164,7 @@ public:
* @return The number of buffers released.
*/
u32 GetRegisteredAppendedBuffers(
boost::container::small_vector<AudioBuffer, N>& buffers_flushed, u32 max_buffers) {
boost::container::static_vector<AudioBuffer, N>& buffers_flushed, u32 max_buffers) {
std::scoped_lock l{lock};
if (registered_count + appended_count == 0) {
return 0;
@@ -272,7 +272,7 @@ public:
*/
bool FlushBuffers(u32& buffers_released) {
std::scoped_lock l{lock};
boost::container::small_vector<AudioBuffer, N> buffers_flushed{};
boost::container::static_vector<AudioBuffer, N> buffers_flushed{};
buffers_released = GetRegisteredAppendedBuffers(buffers_flushed, append_limit);

View File

@@ -2,6 +2,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include <mutex>
#include "audio_core/audio_event.h"
#include "audio_core/audio_manager.h"
#include "audio_core/in/audio_in_system.h"
@@ -89,7 +90,7 @@ Result System::Start() {
session->Start();
state = State::Started;
boost::container::small_vector<AudioBuffer, BufferCount> buffers_to_flush{};
boost::container::static_vector<AudioBuffer, BufferCount> buffers_to_flush{};
buffers.RegisterBuffers(buffers_to_flush);
session->AppendBuffers(buffers_to_flush);
session->SetRingSize(static_cast<u32>(buffers_to_flush.size()));
@@ -134,7 +135,7 @@ bool System::AppendBuffer(const AudioInBuffer& buffer, const u64 tag) {
void System::RegisterBuffers() {
if (state == State::Started) {
boost::container::small_vector<AudioBuffer, BufferCount> registered_buffers{};
boost::container::static_vector<AudioBuffer, BufferCount> registered_buffers{};
buffers.RegisterBuffers(registered_buffers);
session->AppendBuffers(registered_buffers);
}

View File

@@ -89,7 +89,7 @@ Result System::Start() {
session->Start();
state = State::Started;
boost::container::small_vector<AudioBuffer, BufferCount> buffers_to_flush{};
boost::container::static_vector<AudioBuffer, BufferCount> buffers_to_flush{};
buffers.RegisterBuffers(buffers_to_flush);
session->AppendBuffers(buffers_to_flush);
session->SetRingSize(static_cast<u32>(buffers_to_flush.size()));
@@ -134,7 +134,7 @@ bool System::AppendBuffer(const AudioOutBuffer& buffer, u64 tag) {
void System::RegisterBuffers() {
if (state == State::Started) {
boost::container::small_vector<AudioBuffer, BufferCount> registered_buffers{};
boost::container::static_vector<AudioBuffer, BufferCount> registered_buffers{};
buffers.RegisterBuffers(registered_buffers);
session->AppendBuffers(registered_buffers);
}