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

Unified Diff: webrtc/modules/audio_coding/main/acm2/acm_receiver.cc

Issue 1425233003: Hide ACMCodecDB::database_ behind accessors (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@rac-static
Patch Set: rebase Created 5 years, 1 month 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/audio_coding/main/acm2/acm_receiver.cc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_receiver.cc b/webrtc/modules/audio_coding/main/acm2/acm_receiver.cc
index bc9826aca15992f9b6df8f9fc919722af9b65211..b8e8b9d4bc7fe5cb8c401b4c5a8afc412f5abcb6 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_receiver.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_receiver.cc
@@ -439,8 +439,8 @@ int AcmReceiver::LastAudioCodec(CodecInst* codec) const {
if (!last_audio_decoder_) {
return -1;
}
- memcpy(codec, &ACMCodecDB::database_[last_audio_decoder_->acm_codec_id],
- sizeof(CodecInst));
+ *codec = *RentACodec::CodecInstById(
+ *RentACodec::CodecIdFromIndex(last_audio_decoder_->acm_codec_id));
codec->pltype = last_audio_decoder_->payload_type;
codec->channels = last_audio_decoder_->channels;
codec->plfreq = last_audio_decoder_->sample_rate_hz;
@@ -480,8 +480,8 @@ int AcmReceiver::DecoderByPayloadType(uint8_t payload_type,
return -1;
}
const Decoder& decoder = it->second;
- memcpy(codec, &ACMCodecDB::database_[decoder.acm_codec_id],
- sizeof(CodecInst));
+ *codec = *RentACodec::CodecInstById(
+ *RentACodec::CodecIdFromIndex(decoder.acm_codec_id));
codec->pltype = decoder.payload_type;
codec->channels = decoder.channels;
codec->plfreq = decoder.sample_rate_hz;

Powered by Google App Engine
This is Rietveld 408576698