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

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

Issue 1467183002: Add new method AcmReceiver::last_packet_sample_rate_hz() (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@neteq-last-output-rate
Patch Set: Updates after second review 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
« no previous file with comments | « webrtc/modules/audio_coding/main/acm2/acm_receiver_unittest_oldapi.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc
diff --git a/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc b/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc
index 19ae4cbc2b5e6d18e9c22688d6c38dfb177045e5..5d18bda00c3a5e1b9aa12fd5791479e560bbaea4 100644
--- a/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc
+++ b/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc
@@ -525,14 +525,9 @@ int AudioCodingModuleImpl::InitializeReceiverSafe() {
// Get current receive frequency.
int AudioCodingModuleImpl::ReceiveFrequency() const {
- WEBRTC_TRACE(webrtc::kTraceStream, webrtc::kTraceAudioCoding, id_,
- "ReceiveFrequency()");
-
- CriticalSectionScoped lock(acm_crit_sect_.get());
-
- auto codec_id = RentACodec::CodecIdFromIndex(receiver_.last_audio_codec_id());
- return codec_id ? RentACodec::CodecInstById(*codec_id)->plfreq
- : receiver_.last_output_sample_rate_hz();
+ const auto last_packet_sample_rate = receiver_.last_packet_sample_rate_hz();
+ return last_packet_sample_rate ? *last_packet_sample_rate
+ : receiver_.last_output_sample_rate_hz();
}
// Get current playout frequency.
« no previous file with comments | « webrtc/modules/audio_coding/main/acm2/acm_receiver_unittest_oldapi.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698