修复析构中调用getOwnerPoller抛异常导致崩溃的bug:#2117

This commit is contained in:
xiongziliang
2022-11-26 10:14:37 +08:00
parent 9fd5152aa1
commit 50fa671564
4 changed files with 22 additions and 17 deletions

View File

@@ -344,7 +344,8 @@ Value makeMediaSourceJson(MediaSource &media){
}
//getLossRate有线程安全问题使用getMediaInfo接口才能获取丢包率getMediaList接口将忽略丢包率
auto current_thread = media.getOwnerPoller()->isCurrentThread();
auto current_thread = false;
try { current_thread = media.getOwnerPoller()->isCurrentThread();} catch (...) {}
float last_loss = -1;
for(auto &track : media.getTracks(false)){
Value obj;