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

Unified Diff: media/audio/audio_device_thread.cc

Issue 2060833002: Implementation of 'AudioContext.getOutputTimestamp' method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implementation of 'AudioContext.getOutputTimestamp' method Created 4 years, 6 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
Index: media/audio/audio_device_thread.cc
diff --git a/media/audio/audio_device_thread.cc b/media/audio/audio_device_thread.cc
index 20874599e68f5f7cfddeff0022291e64aa718b6c..7074b2174a8497fd19dea5aa0c9af2cd8bccee86 100644
--- a/media/audio/audio_device_thread.cc
+++ b/media/audio/audio_device_thread.cc
@@ -175,6 +175,11 @@ void AudioDeviceThread::Thread::Run() {
if (bytes_read != sizeof(pending_data))
break;
+ AudioTimestamp output_timestamp = {0, 0};
+ bytes_read = socket_.Receive(&output_timestamp, sizeof(output_timestamp));
+ if (bytes_read != sizeof(output_timestamp))
+ break;
+
// std::numeric_limits<uint32_t>::max() is a special signal which is
// returned after the browser stops the output device in response to a
// renderer side request.
@@ -186,7 +191,7 @@ void AudioDeviceThread::Thread::Run() {
if (pending_data != std::numeric_limits<uint32_t>::max()) {
base::AutoLock auto_lock(callback_lock_);
if (callback_)
- callback_->Process(pending_data);
+ callback_->Process(pending_data, output_timestamp);
}
// The usage of |synchronized_buffers_| differs between input and output

Powered by Google App Engine
This is Rietveld 408576698