From 928e7a3e79f34ad5d2748c9c06faa11f4f375490 Mon Sep 17 00:00:00 2001 From: Harald Alvestrand Date: Wed, 31 Jul 2019 07:16:45 -0400 Subject: Make ID of datachannel stats not depend on dc.id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ID of stats was based on the datachannel's "id" attribute, but that could change - it was -1 before ID allocation, and a number afterwards. This CL changes the stats ID to depend on a monotonically increasing counter for allocated datachannels. Bug: webrtc:10842 Change-Id: I3e0c5dc07df8a7a502396de06bbedc9f676994a0 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/147642 Reviewed-by: Henrik Boström Commit-Queue: Harald Alvestrand Cr-Commit-Position: refs/heads/master@{#28720} --- pc/rtc_stats_collector.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pc/rtc_stats_collector.cc') diff --git a/pc/rtc_stats_collector.cc b/pc/rtc_stats_collector.cc index 55735c0b83..8336812081 100644 --- a/pc/rtc_stats_collector.cc +++ b/pc/rtc_stats_collector.cc @@ -1224,7 +1224,7 @@ void RTCStatsCollector::ProduceDataChannelStats_s( pc_->sctp_data_channels()) { std::unique_ptr data_channel_stats( new RTCDataChannelStats( - "RTCDataChannel_" + rtc::ToString(data_channel->id()), + "RTCDataChannel_" + rtc::ToString(data_channel->internal_id()), timestamp_us)); data_channel_stats->label = data_channel->label(); data_channel_stats->protocol = data_channel->protocol(); -- cgit v1.2.3