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: content/renderer/media/html_audio_element_capturer_source.cc

Issue 2025643002: Fixing HtmlAudioElementCapturerSource::OnAudioBus() to accept delay frames intead of milliseconds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/renderer/media/html_audio_element_capturer_source.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/html_audio_element_capturer_source.cc
diff --git a/content/renderer/media/html_audio_element_capturer_source.cc b/content/renderer/media/html_audio_element_capturer_source.cc
index 399c2212ebe0483aec6f26396f9caaef4f46e3ad..7e0edfc9768e65bca06b4649e9c4f25a2c1f0eff 100644
--- a/content/renderer/media/html_audio_element_capturer_source.cc
+++ b/content/renderer/media/html_audio_element_capturer_source.cc
@@ -65,11 +65,12 @@ void HtmlAudioElementCapturerSource::EnsureSourceIsStopped() {
void HtmlAudioElementCapturerSource::OnAudioBus(
std::unique_ptr<media::AudioBus> audio_bus,
- uint32_t delay_milliseconds,
+ uint32_t frames_delayed,
int sample_rate) {
const base::TimeTicks capture_time =
base::TimeTicks::Now() -
- base::TimeDelta::FromMilliseconds(delay_milliseconds);
+ base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond *
+ frames_delayed / sample_rate);
if (sample_rate != last_sample_rate_ ||
audio_bus->channels() != last_num_channels_ ||
« no previous file with comments | « content/renderer/media/html_audio_element_capturer_source.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698