From 1e0af2dadf5e2c25c5f8fbaca0493fdfec131086 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 10 Aug 2021 10:23:37 +0200 Subject: [PATCH] output/pipewire: add type alias for boost::lockfree::spsc_queue --- src/output/plugins/PipeWireOutputPlugin.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/output/plugins/PipeWireOutputPlugin.cxx b/src/output/plugins/PipeWireOutputPlugin.cxx index 33fba8ade..b83bb7399 100644 --- a/src/output/plugins/PipeWireOutputPlugin.cxx +++ b/src/output/plugins/PipeWireOutputPlugin.cxx @@ -61,7 +61,11 @@ class PipeWireOutput final : AudioOutput { std::size_t frame_size; - boost::lockfree::spsc_queue *ring_buffer; + /** + * This buffer passes PCM data from Play() to Process(). + */ + using RingBuffer = boost::lockfree::spsc_queue; + RingBuffer *ring_buffer; const uint32_t target_id; @@ -360,8 +364,9 @@ PipeWireOutput::Open(AudioFormat &audio_format) interrupted = false; /* allocate a ring buffer of 1 second */ - ring_buffer = new boost::lockfree::spsc_queue(frame_size * - audio_format.sample_rate); + const std::size_t ring_buffer_size = + frame_size * audio_format.sample_rate; + ring_buffer = new RingBuffer(ring_buffer_size); const struct spa_pod *params[1];