修复断连续推情况下线程迁移导致崩溃的bug:#2283

如果一个MultiMediaSourceMuxer对象上挂载了很多个RtpSender对象,
这些对象会绑定MultiMediaSourceMuxer的OwnerPoller(归属线程),
在断连续推发生时,对应的MultiMediaSourceMuxer对象OwnerPoller线程
将发生变更,导致与RtpSender对象的线程不一致。
This commit is contained in:
xia-chu
2023-03-11 10:34:28 +08:00
parent 9188ed1613
commit ba4296e180
2 changed files with 6 additions and 0 deletions

View File

@@ -246,6 +246,10 @@ void MultiMediaSourceMuxer::startSendRtp(MediaSource &sender, const MediaSourceE
if (!strong_self || ex) {
return;
}
if (!strong_self->getOwnerPoller(MediaSource::NullMediaSource())->isCurrentThread()) {
// poller线程发生变更了
return;
}
for (auto &track : strong_self->getTracks(false)) {
rtp_sender->addTrack(track);
}