Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/CMakeLists.txt2
-rw-r--r--source/extern/CMakeLists.txt9
-rw-r--r--source/frontend/StarVoice.cpp4
3 files changed, 11 insertions, 4 deletions
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index 4f44bc2..e71ba21 100644
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -437,7 +437,7 @@ SET (STAR_EXT_LIBS ${STAR_EXT_LIBS}
${FREETYPE_LIBRARY}
${PNG_LIBRARY}
${ZLIB_LIBRARY}
- "extern/opus/opus"
+ opus
)
IF (STAR_BUILD_GUI)
diff --git a/source/extern/CMakeLists.txt b/source/extern/CMakeLists.txt
index f2e670c..2e4ea24 100644
--- a/source/extern/CMakeLists.txt
+++ b/source/extern/CMakeLists.txt
@@ -2,10 +2,17 @@ SET (OPUS_INSTALL_PKG_CONFIG_MODULE OFF)
SET (OPUS_INSTALL_CMAKE_CONFIG_MODULE OFF)
SET (OPUS_X86_MAY_HAVE_AVX OFF)
SET (OPUS_X86_MAY_HAVE_SSE4_1 OFF)
-SET (OPUS_STACK_PROTECTOR OFF)
SET (OPUS_ENABLE_FLOAT_API ON)
+SET (OPUS_STACK_PROTECTOR OFF)
+SET (OPUS_NONTHREADSAFE_PSEUDOSTACK OFF)
+SET (OPUS_USE_ALLOCA ON)
+
ADD_SUBDIRECTORY (opus)
+IF (OPUS_NONTHREADSAFE_PSEUDOSTACK)
+ MESSAGE (FATAL_ERROR "Opus should not be using NONTHREADSAFE_PSEUDOSTACK")
+ENDIF ()
+
INCLUDE_DIRECTORIES (
${STAR_EXTERN_INCLUDES}
opus/include
diff --git a/source/frontend/StarVoice.cpp b/source/frontend/StarVoice.cpp
index 4f9051b..dc97070 100644
--- a/source/frontend/StarVoice.cpp
+++ b/source/frontend/StarVoice.cpp
@@ -250,9 +250,9 @@ void Voice::readAudioData(uint8_t* stream, int len) {
ByteArray encoded(VOICE_MAX_PACKET_SIZE, 0);
size_t frameSamples = VOICE_FRAME_SIZE * (size_t)m_deviceChannels;
- std::vector<opus_int16> samples;
- samples.reserve(frameSamples);
while (m_capturedChunksFrames >= VOICE_FRAME_SIZE) {
+ std::vector<opus_int16> samples;
+ samples.reserve(frameSamples);
size_t samplesLeft = frameSamples;
while (samplesLeft && !m_capturedChunks.empty()) {
auto& front = m_capturedChunks.front();