WebRtcVoiceCodecs: Eliminate some useless copying

Review-Url: https://codereview.webrtc.org/2067453002
Cr-Commit-Position: refs/heads/master@{#13151}
This commit is contained in:
kwiberg 2016-06-15 04:34:47 -07:00 committed by Commit bot
parent 111744e1d7
commit edaa849013

View File

@ -395,12 +395,10 @@ class WebRtcVoiceCodecs final {
// Be sure to use the payload type requested by the remote side.
// Ignore codecs we don't know about. The negotiation step should prevent
// this, but double-check to be sure.
webrtc::CodecInst voe_codec = {0};
if (!ToCodecInst(codec, &voe_codec)) {
if (!ToCodecInst(codec, out)) {
LOG(LS_WARNING) << "Unknown codec " << ToString(codec);
continue;
}
*out = voe_codec;
return &codec;
}
return nullptr;