aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-04-14 00:53:15 +0200
committerdec05eba <dec05eba@protonmail.com>2024-04-14 00:53:15 +0200
commitb554628099c72c0e78e34d04e029695c407be541 (patch)
treeb64e9fa7cc34df30bfed86a38765f39ca58f6703 /src/main.cpp
parent2692a7d22c0b691f7f27f969c91e7af05c8ede7d (diff)
Revert "Testing audio latency compensation"
This reverts commit 2692a7d22c0b691f7f27f969c91e7af05c8ede7d.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp
index eb90e91..5aacd8b 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2417,15 +2417,12 @@ int main(int argc, char **argv) {
while(running) {
void *sound_buffer;
int sound_buffer_size = -1;
- double latency_seconds = 0.0;
- const double time_before_read = clock_get_monotonic_seconds();
if(audio_device.sound_device.handle)
- sound_buffer_size = sound_device_read_next_chunk(&audio_device.sound_device, &sound_buffer, 1.0, &latency_seconds);
+ sound_buffer_size = sound_device_read_next_chunk(&audio_device.sound_device, &sound_buffer, timeout_sec);
const bool got_audio_data = sound_buffer_size >= 0;
- const double time_after_read = clock_get_monotonic_seconds();
- latency_seconds = time_after_read - time_before_read; // TODO: Remove this
- const double this_audio_frame_time = (time_after_read - paused_time_offset) - latency_seconds;
+
+ const double this_audio_frame_time = clock_get_monotonic_seconds() - paused_time_offset;
if(paused) {
if(got_audio_data)