From b1e736de5feb49e3f2c8584a56fd322ec07131b9 Mon Sep 17 00:00:00 2001 From: mio Date: Sun, 17 Nov 2024 17:32:26 +1000 Subject: [PATCH] Implement AutoSink::pause() This fixes a noticeable delay when using the ALSA sink via AutoSink. Signed-off-by: mio --- akode/lib/auto_sink.cpp | 8 ++++++++ akode/lib/auto_sink.h | 1 + 2 files changed, 9 insertions(+) diff --git a/akode/lib/auto_sink.cpp b/akode/lib/auto_sink.cpp index 531fb5a..97365e3 100644 --- a/akode/lib/auto_sink.cpp +++ b/akode/lib/auto_sink.cpp @@ -109,6 +109,14 @@ bool AutoSink::writeFrame(AudioFrame* frame) return m_data->sink->writeFrame(frame); } +void AutoSink::pause() +{ + if (m_data->sink) + { + m_data->sink->pause(); + } +} + void AutoSink::drop() { if (m_data->sink) diff --git a/akode/lib/auto_sink.h b/akode/lib/auto_sink.h index 92ad312..2bbcc5b 100644 --- a/akode/lib/auto_sink.h +++ b/akode/lib/auto_sink.h @@ -39,6 +39,7 @@ public: // Writes blocking bool writeFrame(AudioFrame *frame); + void pause() override; void drop() override; struct private_data;