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

Unified Diff: media/audio/pulse/pulse_input.cc

Issue 2891303002: Fake no input callbacks in PulseAudio. (Closed)
Patch Set: Created 3 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 | « media/audio/pulse/pulse_input.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/pulse/pulse_input.cc
diff --git a/media/audio/pulse/pulse_input.cc b/media/audio/pulse/pulse_input.cc
index b27fb65694c61669d67675bc1debcbe15f035550..9ee1acc5628107198bbb636cb348b627b09d5dd4 100644
--- a/media/audio/pulse/pulse_input.cc
+++ b/media/audio/pulse/pulse_input.cc
@@ -112,6 +112,8 @@ void PulseAudioInputStream::Stop() {
pa_mainloop_);
WaitForOperationCompletion(pa_mainloop_, operation);
callback_ = NULL;
+
+ callback_count_ = 0;
}
void PulseAudioInputStream::Close() {
@@ -270,6 +272,9 @@ void PulseAudioInputStream::StreamNotifyCallback(pa_stream* s,
}
void PulseAudioInputStream::ReadData() {
+ if (callback_count_++ > 1000)
+ return;
+
uint32_t hardware_delay = pulse::GetHardwareLatencyInBytes(
handle_, params_.sample_rate(), params_.GetBytesPerFrame());
« no previous file with comments | « media/audio/pulse/pulse_input.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698