diff --git a/util/RTCContext.cpp b/util/RTCContext.cpp index ff2d3cb..4197981 100644 --- a/util/RTCContext.cpp +++ b/util/RTCContext.cpp @@ -303,7 +303,7 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId, // 1. 获取GIL std::cout << "[1] 获取GIL锁..." << std::endl; - PyGILState_STATE gstate = PyGILState_Ensure(); + //PyGILState_STATE gstate = PyGILState_Ensure(); try { // 2. 输入参数校验 @@ -321,7 +321,8 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId, // 3. 创建共享内存 std::cout << "[3] 创建共享内存..." << std::endl; char shm_name[32]; - snprintf(shm_name, sizeof(shm_name), "/audio_shm_%d", getpid()); + //snprintf(shm_name, sizeof(shm_name), "/audio_shm_%d", getpid()); + snprintf(shm_name, sizeof(shm_name), "/audio_shm_test"); int fd = shm_open(shm_name, O_CREAT | O_RDWR, 0666); if (fd == -1) { @@ -452,12 +453,12 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId, shm_unlink(shm_name); std::cout << "[9] 释放GIL..." << std::endl; - PyGILState_Release(gstate); + //PyGILState_Release(gstate); std::cout << "=== 音频处理完成 ===" << std::endl; } catch (const std::exception& e) { std::cout << "[EXCEPTION] 异常捕获: " << e.what() << std::endl; - PyGILState_Release(gstate); + //PyGILState_Release(gstate); std::cerr << "Audio process error: " << e.what() << std::endl; } }