diff options
author | Billy Laws <blaws05@gmail.com> | 2023-03-26 21:07:03 +0200 |
---|---|---|
committer | Billy Laws <blaws05@gmail.com> | 2023-03-27 23:01:41 +0200 |
commit | 237934b73690a56ff756d6e682fa336dee8c95a4 (patch) | |
tree | d2f584df73859445f60d1ee8bb03e0a81e281e46 /src/audio_core/sink | |
parent | audio: Wait for samples on the emulated DSP side to avoid desyncs (diff) | |
download | yuzu-237934b73690a56ff756d6e682fa336dee8c95a4.tar yuzu-237934b73690a56ff756d6e682fa336dee8c95a4.tar.gz yuzu-237934b73690a56ff756d6e682fa336dee8c95a4.tar.bz2 yuzu-237934b73690a56ff756d6e682fa336dee8c95a4.tar.lz yuzu-237934b73690a56ff756d6e682fa336dee8c95a4.tar.xz yuzu-237934b73690a56ff756d6e682fa336dee8c95a4.tar.zst yuzu-237934b73690a56ff756d6e682fa336dee8c95a4.zip |
Diffstat (limited to 'src/audio_core/sink')
-rw-r--r-- | src/audio_core/sink/sink_stream.cpp | 10 | ||||
-rw-r--r-- | src/audio_core/sink/sink_stream.h | 1 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/audio_core/sink/sink_stream.cpp b/src/audio_core/sink/sink_stream.cpp index a54c61845..084ac5edf 100644 --- a/src/audio_core/sink/sink_stream.cpp +++ b/src/audio_core/sink/sink_stream.cpp @@ -245,9 +245,7 @@ void SinkStream::ProcessAudioOutAndRender(std::span<s16> output_buffer, std::siz // Successfully dequeued a new buffer. queued_buffers--; - { - std::unique_lock lk{release_mutex}; - } + { std::unique_lock lk{release_mutex}; } release_cv.notify_one(); } @@ -276,7 +274,8 @@ void SinkStream::ProcessAudioOutAndRender(std::span<s16> output_buffer, std::siz { std::scoped_lock lk{sample_count_lock}; - last_sample_count_update_time = Core::Timing::CyclesToUs(system.CoreTiming().GetClockTicks()); + last_sample_count_update_time = + Core::Timing::CyclesToUs(system.CoreTiming().GetClockTicks()); min_played_sample_count = max_played_sample_count; max_played_sample_count += actual_frames_written; } @@ -315,7 +314,8 @@ u64 SinkStream::GetExpectedPlayedSampleCount() { void SinkStream::WaitFreeSpace() { std::unique_lock lk{release_mutex}; - release_cv.wait(lk, [this]() { return queued_buffers < max_queue_size || system.IsShuttingDown(); }); + release_cv.wait( + lk, [this]() { return queued_buffers < max_queue_size || system.IsShuttingDown(); }); } } // namespace AudioCore::Sink diff --git a/src/audio_core/sink/sink_stream.h b/src/audio_core/sink/sink_stream.h index 709f3b0ec..9806e6d98 100644 --- a/src/audio_core/sink/sink_stream.h +++ b/src/audio_core/sink/sink_stream.h @@ -16,7 +16,6 @@ #include "common/reader_writer_queue.h" #include "common/ring_buffer.h" #include "common/thread.h" -#include "common/polyfill_thread.h" namespace Core { class System; |