summaryrefslogtreecommitdiffstats
path: root/src/audio_core
diff options
context:
space:
mode:
authorFernando S <fsahmkow27@gmail.com>2022-07-10 10:29:56 +0200
committerGitHub <noreply@github.com>2022-07-10 10:29:56 +0200
commit25e47738f71e6a6469ff251dd84e28289133dad1 (patch)
treec431a3b1ee04fb4da60e08ab21d78a5813e9b528 /src/audio_core
parentMerge pull request #8531 from FernandoS27/core-timing-fix-reg (diff)
parentPR (diff)
downloadyuzu-25e47738f71e6a6469ff251dd84e28289133dad1.tar
yuzu-25e47738f71e6a6469ff251dd84e28289133dad1.tar.gz
yuzu-25e47738f71e6a6469ff251dd84e28289133dad1.tar.bz2
yuzu-25e47738f71e6a6469ff251dd84e28289133dad1.tar.lz
yuzu-25e47738f71e6a6469ff251dd84e28289133dad1.tar.xz
yuzu-25e47738f71e6a6469ff251dd84e28289133dad1.tar.zst
yuzu-25e47738f71e6a6469ff251dd84e28289133dad1.zip
Diffstat (limited to 'src/audio_core')
-rw-r--r--src/audio_core/audio_renderer.cpp10
-rw-r--r--src/audio_core/stream.cpp5
2 files changed, 10 insertions, 5 deletions
diff --git a/src/audio_core/audio_renderer.cpp b/src/audio_core/audio_renderer.cpp
index 2ee0a96ed..9191ca093 100644
--- a/src/audio_core/audio_renderer.cpp
+++ b/src/audio_core/audio_renderer.cpp
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include <limits>
+#include <optional>
#include <vector>
#include "audio_core/audio_out.h"
@@ -88,9 +89,12 @@ AudioRenderer::AudioRenderer(Core::Timing::CoreTiming& core_timing_, Core::Memor
stream = audio_out->OpenStream(
core_timing, params.sample_rate, AudioCommon::STREAM_NUM_CHANNELS,
fmt::format("AudioRenderer-Instance{}", instance_number), std::move(release_callback));
- process_event = Core::Timing::CreateEvent(
- fmt::format("AudioRenderer-Instance{}-Process", instance_number),
- [this](std::uintptr_t, std::chrono::nanoseconds) { ReleaseAndQueueBuffers(); });
+ process_event =
+ Core::Timing::CreateEvent(fmt::format("AudioRenderer-Instance{}-Process", instance_number),
+ [this](std::uintptr_t, s64, std::chrono::nanoseconds) {
+ ReleaseAndQueueBuffers();
+ return std::nullopt;
+ });
for (s32 i = 0; i < NUM_BUFFERS; ++i) {
QueueMixedBuffer(i);
}
diff --git a/src/audio_core/stream.cpp b/src/audio_core/stream.cpp
index f8034b04b..cf3d94c53 100644
--- a/src/audio_core/stream.cpp
+++ b/src/audio_core/stream.cpp
@@ -34,9 +34,10 @@ Stream::Stream(Core::Timing::CoreTiming& core_timing_, u32 sample_rate_, Format
ReleaseCallback&& release_callback_, SinkStream& sink_stream_, std::string&& name_)
: sample_rate{sample_rate_}, format{format_}, release_callback{std::move(release_callback_)},
sink_stream{sink_stream_}, core_timing{core_timing_}, name{std::move(name_)} {
- release_event =
- Core::Timing::CreateEvent(name, [this](std::uintptr_t, std::chrono::nanoseconds ns_late) {
+ release_event = Core::Timing::CreateEvent(
+ name, [this](std::uintptr_t, s64 time, std::chrono::nanoseconds ns_late) {
ReleaseActiveBuffer(ns_late);
+ return std::nullopt;
});
}