[fix] solve deadlock caused by destroy ice agent

This commit is contained in:
dijunkun
2024-09-02 16:31:33 +08:00
parent 0b11646619
commit 98bd477af5
8 changed files with 54 additions and 24 deletions

View File

@@ -56,7 +56,7 @@ bool OpusEncoderImpl::PopFrame(StreamInfo &info) {
// 48000 sample rate<74><65>48 samples/ms * 20ms * 2 channel = 1920
void OpusEncoderImpl::EncodeRun() {
m_thread = std::make_unique<std::thread>([this]() {
m_thread = std::thread([this]() {
const int frame_size = 48 * 20; // 1920
int input_len = sizeof(opus_int16) * frame_size * channel_num;

View File

@@ -20,7 +20,7 @@ class OpusEncoderImpl {
std::mutex mutex;
bool isRuning = true;
std::mutex access_mutex;
std::unique_ptr<std::thread> m_thread;
std::thread > m_thread;
OpusDecoderImpl *decoder = nullptr;