diff options
author | Billy Laws <blaws05@gmail.com> | 2023-04-08 22:54:19 +0200 |
---|---|---|
committer | Billy Laws <blaws05@gmail.com> | 2023-04-08 22:54:19 +0200 |
commit | 8908663f1279c690bc19710da7e33d44314641b4 (patch) | |
tree | 522dda751b910c89bfdc93d774d9585b36cc857e /src/audio_core/sink/sink_stream.cpp | |
parent | Add some explicit latency to sample count reporting (diff) | |
download | yuzu-8908663f1279c690bc19710da7e33d44314641b4.tar yuzu-8908663f1279c690bc19710da7e33d44314641b4.tar.gz yuzu-8908663f1279c690bc19710da7e33d44314641b4.tar.bz2 yuzu-8908663f1279c690bc19710da7e33d44314641b4.tar.lz yuzu-8908663f1279c690bc19710da7e33d44314641b4.tar.xz yuzu-8908663f1279c690bc19710da7e33d44314641b4.tar.zst yuzu-8908663f1279c690bc19710da7e33d44314641b4.zip |
Diffstat (limited to 'src/audio_core/sink/sink_stream.cpp')
-rw-r--r-- | src/audio_core/sink/sink_stream.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/audio_core/sink/sink_stream.cpp b/src/audio_core/sink/sink_stream.cpp index 13c73b5d7..13ba26e74 100644 --- a/src/audio_core/sink/sink_stream.cpp +++ b/src/audio_core/sink/sink_stream.cpp @@ -252,8 +252,7 @@ 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 = system.CoreTiming().GetGlobalTimeNs(); min_played_sample_count = max_played_sample_count; max_played_sample_count += actual_frames_written; } @@ -261,7 +260,7 @@ void SinkStream::ProcessAudioOutAndRender(std::span<s16> output_buffer, std::siz u64 SinkStream::GetExpectedPlayedSampleCount() { std::scoped_lock lk{sample_count_lock}; - auto cur_time{Core::Timing::CyclesToUs(system.CoreTiming().GetClockTicks())}; + auto cur_time{system.CoreTiming().GetGlobalTimeNs()}; auto time_delta{cur_time - last_sample_count_update_time}; auto exp_played_sample_count{min_played_sample_count + (TargetSampleRate * time_delta) / std::chrono::seconds{1}}; |