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

Unified Diff: webrtc/modules/audio_device/ios/audio_device_ios.mm

Issue 2715963002: Simplifies FineAudioBuffer by using rtc::Buffer (Closed)
Patch Set: final nits Created 3 years, 10 months 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_device/fine_audio_buffer_unittest.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_device/ios/audio_device_ios.mm
diff --git a/webrtc/modules/audio_device/ios/audio_device_ios.mm b/webrtc/modules/audio_device/ios/audio_device_ios.mm
index bc7ceb84588d7b2c1ed6f48e4be65175af5d923f..5f9e0e75250752af86b92e4ef0d863185073f6ca 100644
--- a/webrtc/modules/audio_device/ios/audio_device_ios.mm
+++ b/webrtc/modules/audio_device/ios/audio_device_ios.mm
@@ -627,17 +627,11 @@ void AudioDeviceIOS::SetupAudioBuffersForActiveAudioSession() {
// or deliver, any number of samples (and not only multiple of 10ms) to match
// the native audio unit buffer size.
RTC_DCHECK(audio_device_buffer_);
+ const size_t buffer_size_in_bytes = playout_parameters_.GetBytesPerBuffer();
fine_audio_buffer_.reset(new FineAudioBuffer(
- audio_device_buffer_, playout_parameters_.GetBytesPerBuffer(),
+ audio_device_buffer_, buffer_size_in_bytes,
playout_parameters_.sample_rate()));
-
- // The extra/temporary playoutbuffer must be of this size to avoid
- // unnecessary memcpy while caching data between successive callbacks.
- const int required_playout_buffer_size =
- fine_audio_buffer_->RequiredPlayoutBufferSizeBytes();
- LOG(LS_INFO) << " required playout buffer size: "
- << required_playout_buffer_size;
- playout_audio_buffer_.reset(new SInt8[required_playout_buffer_size]);
+ playout_audio_buffer_.reset(new SInt8[buffer_size_in_bytes]);
// Allocate AudioBuffers to be used as storage for the received audio.
// The AudioBufferList structure works as a placeholder for the
« no previous file with comments | « webrtc/modules/audio_device/fine_audio_buffer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698