Browse Source

fix audio

Signed-off-by: lizzie <lizzie@eden-emu.dev>
pull/2763/head
lizzie 5 months ago
parent
commit
69619249d9
No known key found for this signature in database GPG Key ID: 287378CADCAB13
  1. 19
      src/audio_core/in/audio_in_system.cpp
  2. 19
      src/audio_core/out/audio_out_system.cpp
  3. 2
      src/video_core/texture_cache/util.h

19
src/audio_core/in/audio_in_system.cpp

@ -11,6 +11,21 @@
#include "core/core_timing.h"
#include "core/hle/kernel/k_event.h"
// See texture_cache/util.h
template<typename T, size_t N>
#if BOOST_VERSION >= 108100 || __GNUC__ > 12
[[nodiscard]] boost::container::static_vector<T, N> FixStaticVectorADL(const boost::container::static_vector<T, N>& v) {
return v;
}
#else
[[nodiscard]] std::vector<T> FixStaticVectorADL(const boost::container::static_vector<T, N>& v) {
std::vector<T> u;
for (auto const& e : v)
u.push_back(e);
return u;
}
#endif
namespace AudioCore::AudioIn {
System::System(Core::System& system_, Kernel::KEvent* event_, const size_t session_id_)
@ -92,7 +107,7 @@ Result System::Start() {
boost::container::static_vector<AudioBuffer, BufferCount> buffers_to_flush{};
buffers.RegisterBuffers(buffers_to_flush);
session->AppendBuffers(buffers_to_flush);
session->AppendBuffers(FixStaticVectorADL(buffers_to_flush));
session->SetRingSize(static_cast<u32>(buffers_to_flush.size()));
return ResultSuccess;
@ -137,7 +152,7 @@ void System::RegisterBuffers() {
if (state == State::Started) {
boost::container::static_vector<AudioBuffer, BufferCount> registered_buffers{};
buffers.RegisterBuffers(registered_buffers);
session->AppendBuffers(registered_buffers);
session->AppendBuffers(FixStaticVectorADL(registered_buffers));
}
}

19
src/audio_core/out/audio_out_system.cpp

@ -11,6 +11,21 @@
#include "core/core_timing.h"
#include "core/hle/kernel/k_event.h"
// See texture_cache/util.h
template<typename T, size_t N>
#if BOOST_VERSION >= 108100 || __GNUC__ > 12
[[nodiscard]] boost::container::static_vector<T, N> FixStaticVectorADL(const boost::container::static_vector<T, N>& v) {
return v;
}
#else
[[nodiscard]] std::vector<T> FixStaticVectorADL(const boost::container::static_vector<T, N>& v) {
std::vector<T> u;
for (auto const& e : v)
u.push_back(e);
return u;
}
#endif
namespace AudioCore::AudioOut {
System::System(Core::System& system_, Kernel::KEvent* event_, size_t session_id_)
@ -91,7 +106,7 @@ Result System::Start() {
boost::container::static_vector<AudioBuffer, BufferCount> buffers_to_flush{};
buffers.RegisterBuffers(buffers_to_flush);
session->AppendBuffers(buffers_to_flush);
session->AppendBuffers(FixStaticVectorADL(buffers_to_flush));
session->SetRingSize(static_cast<u32>(buffers_to_flush.size()));
return ResultSuccess;
@ -136,7 +151,7 @@ void System::RegisterBuffers() {
if (state == State::Started) {
boost::container::static_vector<AudioBuffer, BufferCount> registered_buffers{};
buffers.RegisterBuffers(registered_buffers);
session->AppendBuffers(registered_buffers);
session->AppendBuffers(FixStaticVectorADL(registered_buffers));
}
}

2
src/video_core/texture_cache/util.h

@ -127,6 +127,8 @@ void DeduceBlitImages(ImageInfo& dst_info, ImageInfo& src_info, const ImageBase*
// for any given type of the static_vector/small_vector, etc which makes a whole mess
// for anything using std::span<T> so we just do this terrible hack on older versions of
// GCC12 because people actually still use stable debian so... yeah
// One may say: "This is bad for performance" - to which I say, using GCC 12 you already know
// what kind of bs you will be dealing with anyways.
template<typename T, size_t N>
#if BOOST_VERSION >= 108100 || __GNUC__ > 12
[[nodiscard]] boost::container::small_vector<T, N> FixSmallVectorADL(const boost::container::small_vector<T, N>& v) {

Loading…
Cancel
Save