From 0638f03ad4da8b61b85aabc6641f57ef86691b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Thu, 9 Mar 2023 22:20:49 +0100 Subject: [PATCH] Enoder Opus: Fix caluculation of the reqired raw samples m_readRequired --- src/encoder/encoderopus.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/encoder/encoderopus.cpp b/src/encoder/encoderopus.cpp index 3ed88349efd..92cd27ada21 100644 --- a/src/encoder/encoderopus.cpp +++ b/src/encoder/encoderopus.cpp @@ -197,7 +197,7 @@ int EncoderOpus::initEncoder(int samplerate, QString* pUserErrorMessage) { opus_encoder_ctl(m_pOpus, OPUS_SET_VBR_CONSTRAINT(0)); // Unconstrained VBR } - m_readRequired = m_samplerate * kOpusFrameMs; + m_readRequired = m_channels * m_samplerate * kOpusFrameMs / 1000; m_pFifoChunkBuffer = std::make_unique(m_readRequired); initStream();