Choose the SDL audio backend when Cubeb reports too high of a latency

This commit is contained in:
Kelebek1
2022-10-08 19:27:54 +01:00
parent 61883d8820
commit 8c9e238a7b
7 changed files with 95 additions and 32 deletions

View File

@ -47,11 +47,7 @@ public:
spec.freq = TargetSampleRate;
spec.channels = static_cast<u8>(device_channels);
spec.format = AUDIO_S16SYS;
if (type == StreamType::Render) {
spec.samples = TargetSampleCount;
} else {
spec.samples = 1024;
}
spec.samples = TargetSampleCount * 2;
spec.callback = &SDLSinkStream::DataCallback;
spec.userdata = this;
@ -240,4 +236,8 @@ std::vector<std::string> ListSDLSinkDevices(bool capture) {
return device_list;
}
u32 GetSDLLatency() {
return TargetSampleCount * 2;
}
} // namespace AudioCore::Sink