mirror of
https://git.h3cjp.net/H3cJP/yuzu.git
synced 2024-12-27 21:46:44 +00:00
Add some explicit latency to sample count reporting
Some games have very tight scheduling requirements for their audio which can't really be matched on the host, adding a constant to the reported value helps to provide some leeway.
This commit is contained in:
parent
bbdfe1fab1
commit
0afb9631b5
|
@ -266,7 +266,8 @@ u64 SinkStream::GetExpectedPlayedSampleCount() {
|
||||||
auto exp_played_sample_count{min_played_sample_count +
|
auto exp_played_sample_count{min_played_sample_count +
|
||||||
(TargetSampleRate * time_delta) / std::chrono::seconds{1}};
|
(TargetSampleRate * time_delta) / std::chrono::seconds{1}};
|
||||||
|
|
||||||
return std::min<u64>(exp_played_sample_count, max_played_sample_count);
|
// Add 15ms of latency in sample reporting to allow for some leeway in scheduler timings
|
||||||
|
return std::min<u64>(exp_played_sample_count, max_played_sample_count) + TargetSampleCount * 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SinkStream::WaitFreeSpace() {
|
void SinkStream::WaitFreeSpace() {
|
||||||
|
|
Loading…
Reference in a new issue