mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-04 01:37:33 +08:00
修复webrtc多候选地址无法来回切换的bug (#2266)
最后一个连通的候选地址会被赋值并锁定为_selected_session,如果之前的候选地址再发送数据,将通过_selected_session回复,导致无法切换为旧的候选地址。
This commit is contained in:
@@ -70,21 +70,17 @@ void WebRtcPlayer::onStartWebRTC() {
|
||||
}
|
||||
}
|
||||
void WebRtcPlayer::onDestory() {
|
||||
WebRtcTransportImp::onDestory();
|
||||
|
||||
auto duration = getDuration();
|
||||
auto bytes_usage = getBytesUsage();
|
||||
//流量统计事件广播
|
||||
GET_CONFIG(uint32_t, iFlowThreshold, General::kFlowThreshold);
|
||||
if (_reader && getSession()) {
|
||||
WarnL << "RTC播放器("
|
||||
<< _media_info.shortUrl()
|
||||
<< ")结束播放,耗时(s):" << duration;
|
||||
WarnL << "RTC播放器(" << _media_info.shortUrl() << ")结束播放,耗时(s):" << duration;
|
||||
if (bytes_usage >= iFlowThreshold * 1024) {
|
||||
NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastFlowReport, _media_info, bytes_usage, duration,
|
||||
true, static_cast<SockInfo &>(*getSession()));
|
||||
NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastFlowReport, _media_info, bytes_usage, duration, true, static_cast<SockInfo &>(*getSession()));
|
||||
}
|
||||
}
|
||||
WebRtcTransportImp::onDestory();
|
||||
}
|
||||
|
||||
void WebRtcPlayer::onRtcConfigure(RtcConfigure &configure) const {
|
||||
|
||||
Reference in New Issue
Block a user