summaryrefslogtreecommitdiffstats
path: root/src/VLCInput.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-01-10 17:35:23 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-01-10 17:35:23 +0100
commit90c973307607be9ed8f943a79a36a28a46c07502 (patch)
tree6f9d9cc7187e3c4f6fb11a95462c341998017049 /src/VLCInput.cpp
parente4821033a325b748c1c69848554b349c76ba6f59 (diff)
downloadODR-AudioEnc-90c973307607be9ed8f943a79a36a28a46c07502.tar.gz
ODR-AudioEnc-90c973307607be9ed8f943a79a36a28a46c07502.tar.bz2
ODR-AudioEnc-90c973307607be9ed8f943a79a36a28a46c07502.zip
Fix VLC queue fill and increase queue size
Diffstat (limited to 'src/VLCInput.cpp')
-rw-r--r--src/VLCInput.cpp10
1 files changed, 7 insertions, 3 deletions
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);
}
}