From 90c973307607be9ed8f943a79a36a28a46c07502 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sun, 10 Jan 2016 17:35:23 +0100 Subject: Fix VLC queue fill and increase queue size --- src/VLCInput.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/VLCInput.cpp') diff --git a/src/VLCInput.cpp b/src/VLCInput.cpp index 890de01..4ec9208 100644 --- a/src/VLCInput.cpp +++ b/src/VLCInput.cpp @@ -368,11 +368,15 @@ void VLCInputThreaded::start() } } +// How many samples we insert into the queue each call +// 10 samples @ 32kHz = 3.125ms +#define NUM_BYTES_PER_CALL (10 * BYTES_PER_SAMPLE) + void VLCInputThreaded::process() { - uint8_t samplebuf[NUM_SAMPLES_PER_CALL * BYTES_PER_SAMPLE * m_channels]; + uint8_t samplebuf[NUM_BYTES_PER_CALL]; while (m_running) { - ssize_t n = m_read(samplebuf, NUM_SAMPLES_PER_CALL); + ssize_t n = m_read(samplebuf, NUM_BYTES_PER_CALL); if (n < 0) { m_running = false; @@ -380,7 +384,7 @@ void VLCInputThreaded::process() break; } - m_queue.push(samplebuf, BYTES_PER_SAMPLE*m_channels*n); + m_queue.push(samplebuf, n); } } -- cgit v1.2.3