copy-red: Fill an rtc::Buffer with bytes the easy way

The easy way also happens to be more efficient if we have to
reallocate, but that's a minor concern here.

Review URL: https://codereview.webrtc.org/1327053002

Cr-Commit-Position: refs/heads/master@{#9876}
This commit is contained in:
kwiberg
2015-09-07 20:14:31 -07:00
committed by Commit bot
parent 86d907cffd
commit 81db11aa50

View File

@ -88,8 +88,7 @@ AudioEncoder::EncodedInfo AudioEncoderCopyRed::EncodeInternal(
DCHECK_EQ(info.redundant.size(), 2u);
}
// Save primary to secondary.
secondary_encoded_.SetSize(info.encoded_bytes);
memcpy(secondary_encoded_.data(), encoded, info.encoded_bytes);
secondary_encoded_.SetData(encoded, info.encoded_bytes);
secondary_info_ = info;
DCHECK_EQ(info.speech, info.redundant[0].speech);
}