[fix] only display client side net status if connected to itself

This commit is contained in:
dijunkun
2024-11-19 22:33:59 +08:00
parent 5ac603977d
commit 0ba12f3ccf
3 changed files with 8 additions and 10 deletions

View File

@@ -351,12 +351,12 @@ void Render::NetStatusReport(const char *client_id, size_t client_id_size,
LOG_INFO("Net mode: [{}]", int(render->traversal_mode_));
}
if (net_traffic_stats && nullptr == strstr(client_id, "C-")) {
render->net_traffic_stats_.video_in = net_traffic_stats->video_in;
render->net_traffic_stats_.video_out = net_traffic_stats->video_out;
render->net_traffic_stats_.audio_in = net_traffic_stats->audio_in;
render->net_traffic_stats_.audio_out = net_traffic_stats->audio_out;
render->net_traffic_stats_.total_in = net_traffic_stats->total_in;
render->net_traffic_stats_.total_out = net_traffic_stats->total_out;
if (!net_traffic_stats) {
return;
}
// only display client side net status if connected to itself
if (!(render->peer_reserved_ && !strstr(client_id, "C-"))) {
render->net_traffic_stats_ = *net_traffic_stats;
}
}