Bug 1341162 - Fix -Wunreachable-code-return warning in webrtc/signaling. r?bwc
The WebrtcVideoConduit::GetRTCPSenderReport() member function has an unnecessary scope block and unreachable `return false`.
media/webrtc/signaling/src/media-conduit/VideoConduit.cpp:847:10 [-Wunreachable-code-return] 'return' will never be executed
MozReview-Commit-ID: 1GFcupqcA9k
--- a/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
+++ b/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
@@ -818,36 +818,34 @@ bool WebrtcVideoConduit::GetRTCPReceiver
return true;
}
bool
WebrtcVideoConduit::GetRTCPSenderReport(DOMHighResTimeStamp* timestamp,
unsigned int* packetsSent,
uint64_t* bytesSent)
{
- {
- CSFLogVerbose(logTag, "%s for VideoConduit:%p", __FUNCTION__, this);
- MutexAutoLock lock(mCodecMutex);
- if (!mSendStream) {
- return false;
- }
+ CSFLogVerbose(logTag, "%s for VideoConduit:%p", __FUNCTION__, this);
+ MutexAutoLock lock(mCodecMutex);
+ if (!mSendStream) {
+ return false;
+ }
- const webrtc::VideoSendStream::Stats& stats = mSendStream->GetStats();
- *packetsSent = 0;
- for (auto entry: stats.substreams){
- *packetsSent += entry.second.rtp_stats.transmitted.packets;
- // NG -- per https://www.w3.org/TR/webrtc-stats/ this is only payload bytes
- *bytesSent += entry.second.rtp_stats.MediaPayloadBytes();
- }
- // Note: timestamp is not correct per the spec... should be time the rtcp
- // was received (remote) or sent (local)
- *timestamp = webrtc::Clock::GetRealTimeClock()->TimeInMilliseconds();
- return true;
+ const webrtc::VideoSendStream::Stats& stats = mSendStream->GetStats();
+ *packetsSent = 0;
+ for (auto entry: stats.substreams){
+ *packetsSent += entry.second.rtp_stats.transmitted.packets;
+ // NG -- per https://www.w3.org/TR/webrtc-stats/ this is only payload bytes
+ *bytesSent += entry.second.rtp_stats.MediaPayloadBytes();
}
- return false;
+
+ // Note: timestamp is not correct per the spec... should be time the rtcp
+ // was received (remote) or sent (local)
+ *timestamp = webrtc::Clock::GetRealTimeClock()->TimeInMilliseconds();
+ return true;
}
MediaConduitErrorCode
WebrtcVideoConduit::InitMain()
{
#if defined(MOZILLA_INTERNAL_API)
// already know we must be on MainThread barring unit test weirdness
MOZ_ASSERT(NS_IsMainThread());