Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc

Issue 1493403003: modules/rtp_rtcp/include folder cleared of lint warnings (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: webrtc do not use newly depricated functions itself. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc b/webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc
index a5bfd7166495109ff4bbc61b43b7b9d760dd982f..48dcee798e89e278c9e8f4577e032c143761c329 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc
@@ -343,17 +343,16 @@ bool RTPPayloadRegistry::GetPayloadSpecifics(uint8_t payload_type,
int RTPPayloadRegistry::GetPayloadTypeFrequency(
uint8_t payload_type) const {
- RtpUtility::Payload* payload;
- if (!PayloadTypeToPayload(payload_type, payload)) {
+ const RtpUtility::Payload* payload = PayloadTypeToPayload(payload_type);
+ if (payload == nullptr) {
mflodman 2015/12/09 09:19:13 We've started going towards 'if (!payload)' rather
danilchap 2015/12/09 11:23:36 Done.
return -1;
}
CriticalSectionScoped cs(crit_sect_.get());
return rtp_payload_strategy_->GetPayloadTypeFrequency(*payload);
}
-bool RTPPayloadRegistry::PayloadTypeToPayload(
- const uint8_t payload_type,
- RtpUtility::Payload*& payload) const {
+RtpUtility::Payload* RTPPayloadRegistry::PayloadTypeToPayload(
+ uint8_t payload_type) const {
CriticalSectionScoped cs(crit_sect_.get());
RtpUtility::PayloadTypeMap::const_iterator it =
@@ -361,11 +360,10 @@ bool RTPPayloadRegistry::PayloadTypeToPayload(
// Check that this is a registered payload type.
if (it == payload_type_map_.end()) {
- return false;
+ return nullptr;
}
- payload = it->second;
- return true;
+ return it->second;
}
void RTPPayloadRegistry::SetIncomingPayloadType(const RTPHeader& header) {

Powered by Google App Engine
This is Rietveld 408576698