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

Unified Diff: trunk/src/media/audio/audio_low_latency_input_output_unittest.cc

Issue 487543002: Revert 290359 "Remove AudioBuffersState class." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 4 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 | « trunk/src/media/audio/audio_io.h ('k') | trunk/src/media/audio/audio_output_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/media/audio/audio_low_latency_input_output_unittest.cc
===================================================================
--- trunk/src/media/audio/audio_low_latency_input_output_unittest.cc (revision 290374)
+++ trunk/src/media/audio/audio_low_latency_input_output_unittest.cc (working copy)
@@ -226,14 +226,23 @@
// AudioOutputStream::AudioSourceCallback.
virtual int OnMoreData(AudioBus* audio_bus,
- int total_bytes_delay) OVERRIDE {
+ AudioBuffersState buffers_state) OVERRIDE {
base::AutoLock lock(lock_);
// Update one component in the AudioDelayState for the packet
// which is about to be played out.
if (output_elements_to_write_ < kMaxDelayMeasurements) {
+ int output_delay_bytes = buffers_state.hardware_delay_bytes;
+#if defined(OS_WIN)
+ // Special fix for Windows in combination with Wave where the
+ // pending bytes field of the audio buffer state is used to
+ // report the delay.
+ if (!CoreAudioUtil::IsSupported()) {
+ output_delay_bytes = buffers_state.pending_bytes;
+ }
+#endif
delay_states_[output_elements_to_write_].output_delay_ms =
- BytesToMilliseconds(total_bytes_delay);
+ BytesToMilliseconds(output_delay_bytes);
++output_elements_to_write_;
}
« no previous file with comments | « trunk/src/media/audio/audio_io.h ('k') | trunk/src/media/audio/audio_output_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698