Index: webrtc/media/engine/webrtcvoiceengine.cc |
diff --git a/webrtc/media/engine/webrtcvoiceengine.cc b/webrtc/media/engine/webrtcvoiceengine.cc |
index df93ac28f44db14448bc59ef597d70e5415c71f6..3c15385dbdfd943c597e1abf748b9f95100a75cd 100644 |
--- a/webrtc/media/engine/webrtcvoiceengine.cc |
+++ b/webrtc/media/engine/webrtcvoiceengine.cc |
@@ -1159,22 +1159,19 @@ AudioCodecs WebRtcVoiceEngine::CollectRecvCodecs() const { |
rtc::Optional<AudioCodec> opt_codec = mapper.ToAudioCodec(format); |
if (!opt_codec) { |
LOG(LS_ERROR) << "Unable to assign payload type to format: " << format; |
- return false; |
- } |
- |
- auto& codec = *opt_codec; |
- if (IsCodec(codec, kOpusCodecName)) { |
- // TODO(ossu): Set this specifically for Opus for now, until we have a |
- // better way of dealing with rtcp-fb parameters. |
- codec.AddFeedbackParam( |
- FeedbackParam(kRtcpFbParamTransportCc, kParamValueEmpty)); |
} |
- out.push_back(codec); |
- return true; |
+ return opt_codec; |
}; |
for (const auto& spec : specs) { |
- if (map_format(spec.format)) { |
+ rtc::Optional<AudioCodec> opt_codec = map_format(spec.format); |
+ if (opt_codec) { |
+ AudioCodec& codec = *opt_codec; |
+ if (spec.supports_network_adaption) { |
+ codec.AddFeedbackParam( |
+ FeedbackParam(kRtcpFbParamTransportCc, kParamValueEmpty)); |
+ } |
+ |
if (spec.allow_comfort_noise) { |
// Generate a CN entry if the decoder allows it and we support the |
// clockrate. |
@@ -1189,6 +1186,8 @@ AudioCodecs WebRtcVoiceEngine::CollectRecvCodecs() const { |
if (dtmf != generate_dtmf.end()) { |
dtmf->second = true; |
} |
+ |
+ out.push_back(codec); |
} |
} |