summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2026-03-12 14:35:20 +0100
committer hap <happppp@users.noreply.github.com>2026-03-12 14:35:20 +0100
commit2ca08f87aca5c4d7b40a972e2bad04af128683c6 (patch)
tree5cffcadb03e7a505a60e1d67147206bf27cb4ed0 /src/osd
parentbfae7c674b91b7ac2a4489330a034607d81cc968 (diff)
sound abuffer: audio latency is a float
Diffstat (limited to 'src/osd')
-rw-r--r--src/osd/modules/sound/sound_module.cpp4
-rw-r--r--src/osd/modules/sound/sound_module.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/osd/modules/sound/sound_module.cpp b/src/osd/modules/sound/sound_module.cpp
index 486d4023d52..80ec56f885e 100644
--- a/src/osd/modules/sound/sound_module.cpp
+++ b/src/osd/modules/sound/sound_module.cpp
@@ -23,10 +23,10 @@ sound_module::abuffer::abuffer(uint32_t channels) noexcept :
clear();
}
-void sound_module::abuffer::set_latency(uint32_t latency)
+void sound_module::abuffer::set_latency(float latency)
{
// set maximum buffers from latency in 20ms steps (the default of 8 is 0.16s)
- m_max_buffers = std::max(latency + latency / 2, latency + 3);
+ m_max_buffers = std::max<uint32_t>(latency + latency / 2.0f, latency + 3);
m_max_buffers = std::clamp(m_max_buffers, 4U, 50U);
}
diff --git a/src/osd/modules/sound/sound_module.h b/src/osd/modules/sound/sound_module.h
index dd24723ff1d..69ef1732fde 100644
--- a/src/osd/modules/sound/sound_module.h
+++ b/src/osd/modules/sound/sound_module.h
@@ -39,7 +39,7 @@ protected:
class abuffer {
public:
abuffer(uint32_t channels) noexcept;
- void set_latency(uint32_t latency);
+ void set_latency(float latency);
void clear();
void get(int16_t *data, uint32_t samples) noexcept;
void push(const int16_t *data, uint32_t samples);