This commit is contained in:
wangjiyu 2025-04-14 21:11:08 +08:00
parent 92027296d6
commit 8ca3f612ed
2 changed files with 5 additions and 1 deletions

View File

@ -515,6 +515,7 @@ bool RTCContext::initSend(const char* srcRoomId, const char* destRoomId, const i
sleep(3); sleep(3);
} }
if (std::string(srcRoomId) != std::string(destRoomId)) { if (std::string(srcRoomId) != std::string(destRoomId)) {
isMultiRoom_ = true;
std::cout << "join multi room" << std::endl; std::cout << "join multi room" << std::endl;
int16_t ret1 = rtcEngine_->joinMultiRoom(destRoomId); int16_t ret1 = rtcEngine_->joinMultiRoom(destRoomId);
if (ret1 != 0) if (ret1 != 0)
@ -522,6 +523,8 @@ bool RTCContext::initSend(const char* srcRoomId, const char* destRoomId, const i
std::cout << "joinMultiRoom fail, ret:" << ret1; std::cout << "joinMultiRoom fail, ret:" << ret1;
return false; return false;
} }
} else {
isMultiRoom_ = false;
} }
mrtc::MRTCAudioOption option; mrtc::MRTCAudioOption option;
@ -554,7 +557,7 @@ int16_t RTCContext::sendAudioData(uint8_t channelIndex, const void* pData, int32
int16_t RTCContext::sendCustomAudioData(const int16_t channelIndex, void* customData, int32_t sampleRate, int16_t RTCContext::sendCustomAudioData(const int16_t channelIndex, void* customData, int32_t sampleRate,
uint64_t channelNum, uint64_t dataLen) uint64_t channelNum, uint64_t dataLen)
{ {
while(!isOnRoom_ || !isJoinMultiRoom_) { while(!isOnRoom_ || (isMultiRoom_ && !isJoinMultiRoom_)) {
std::cout << "wait for room and multi room before send" << std::endl; std::cout << "wait for room and multi room before send" << std::endl;
sleep(3); sleep(3);
} }

View File

@ -105,6 +105,7 @@ private:
bool isOnRoom_ = false; bool isOnRoom_ = false;
bool isOnConsumer_ = false; bool isOnConsumer_ = false;
bool isJoinMultiRoom_ = false; bool isJoinMultiRoom_ = false;
bool isMultiRoom_ = false;
boost::python::object pyCallback_; boost::python::object pyCallback_;
void ** numpyApi_; void ** numpyApi_;
void onRoom(uint32_t typeId, RTCENGINE_NAMESPACE::MRTCRoomInfo& roomInfo); void onRoom(uint32_t typeId, RTCENGINE_NAMESPACE::MRTCRoomInfo& roomInfo);