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

Unified Diff: webrtc/common_audio/blocker.cc

Issue 1252943007: Split MoveReadPosition into Forward and Backward versions. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Descriptive comments. Created 5 years, 5 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/common_audio/audio_ring_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/common_audio/blocker.cc
diff --git a/webrtc/common_audio/blocker.cc b/webrtc/common_audio/blocker.cc
index 9569df4701d877510ecb0c2e2f857697b64fe5ce..6d171ca87c59d29ebad4d821e08d834893cf725a 100644
--- a/webrtc/common_audio/blocker.cc
+++ b/webrtc/common_audio/blocker.cc
@@ -119,10 +119,10 @@ Blocker::Blocker(int chunk_size,
shift_amount_(shift_amount),
callback_(callback) {
CHECK_LE(num_output_channels_, num_input_channels_);
- CHECK(window);
+ CHECK_LE(shift_amount_, block_size_);
memcpy(window_.get(), window, block_size_ * sizeof(*window_.get()));
- input_buffer_.MoveReadPosition(-initial_delay_);
+ input_buffer_.MoveReadPositionBackward(initial_delay_);
}
// When block_size < chunk_size the input and output buffers look like this:
@@ -180,7 +180,7 @@ void Blocker::ProcessChunk(const float* const* input,
while (first_frame_in_block < chunk_size_) {
input_buffer_.Read(input_block_.channels(), num_input_channels,
block_size_);
- input_buffer_.MoveReadPosition(-block_size_ + shift_amount_);
+ input_buffer_.MoveReadPositionBackward(block_size_ - shift_amount_);
ApplyWindow(window_.get(),
block_size_,
« no previous file with comments | « webrtc/common_audio/audio_ring_buffer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698