Closed Bug 1339104 Opened 3 years ago Closed 3 years ago

RTCStats outbound-rtp.bytesSent is not sane

Categories

(Core :: WebRTC, defect, P1)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1343691

People

(Reporter: ng, Assigned: ng)

References

Details

Attachments

(1 file)

outbound-rtp.bytesSent is presenting numbers like: 4840814017 in local mochitests.
Assignee: nobody → na-g
Rank: 15
OS: Unspecified → All
Priority: -- → P1
Hardware: Unspecified → All
It looks like rttMs was also not ensured to be initialized, though the likelihood of that was very low. webrtc.org would have to return a negative rtt.
Comment on attachment 8836786 [details]
Bug 1339104 - 'Make sure bytesSent, rttMs are initialized. '

https://reviewboard.mozilla.org/r/112106/#review113548

::: media/webrtc/signaling/src/media-conduit/VideoConduit.cpp:803
(Diff revision 1)
>      *bytesReceived = stats.rtp_stats.MediaPayloadBytes();
>      *packetsReceived = stats.rtp_stats.transmitted.packets;
>      // Note: timestamp is not correct per the spec... should be time the rtcp
>      // was received (remote) or sent (local)
>      *timestamp = webrtc::Clock::GetRealTimeClock()->TimeInMilliseconds();
> -    int64_t rtt = mRecvStream->GetRtt();
> +    *rttMs = static_cast<int32_t>(std::max<int64_t>(mRecvStream->GetRtt(), 0));

Might be worth a comment that this sets it to zero in case of failure (-1)

::: media/webrtc/signaling/src/media-conduit/VideoConduit.cpp:823
(Diff revision 1)
>  
> -    const webrtc::VideoSendStream::Stats& stats = mSendStream->GetStats();
>      *packetsSent = 0;
> -    for (auto entry: stats.substreams){
> +    *bytesSent = 0;
> +    const webrtc::VideoSendStream::Stats& stats = mSendStream->GetStats();
> +    for (auto entry: stats.substreams) {

If you're doing whitespace changes then add a space before the : as well please.
Attachment #8836786 - Flags: review?(jib) → review+
Depends on: 1337525
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1343691
You need to log in before you can comment on or make changes to this bug.