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

Unified Diff: media/audio/audio_device_thread.cc

Issue 1302423006: Ensure that data is not overwritten in the audio input shared memory ring buffer that sits on the b… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed log call expectations for Android in unit test. Rebase. Created 5 years, 3 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 | « content/content_tests.gypi ('k') | media/audio/audio_input_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_device_thread.cc
diff --git a/media/audio/audio_device_thread.cc b/media/audio/audio_device_thread.cc
index a0f283ee5638ae49c01637c402c511700b942dfe..9447293979415cccca39977c937f55c0d9f4f576 100644
--- a/media/audio/audio_device_thread.cc
+++ b/media/audio/audio_device_thread.cc
@@ -183,8 +183,15 @@ void AudioDeviceThread::Thread::Run() {
callback_->Process(pending_data);
}
- // Let the other end know which buffer we just filled. The buffer index is
- // used to ensure the other end is getting the buffer it expects. For more
+ // The usage of |synchronized_buffers_| differs between input and output
+ // cases.
+ // Input:
+ // Let the other end know that we have read data, so that it can verify
+ // it doesn't overwrite any data before read. The |buffer_index| value is
+ // not used. For more details, see AudioInputSyncWriter::Write().
+ // Output:
+ // Let the other end know which buffer we just filled. The |buffer_index| is
+ // used to ensure the other end is getting the buffer it expects. For more
// details on how this works see AudioSyncReader::WaitUntilDataIsReady().
if (synchronized_buffers_) {
++buffer_index;
« no previous file with comments | « content/content_tests.gypi ('k') | media/audio/audio_input_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698