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

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

Issue 621093002: Clear the FIFO when calling input stream::Stop() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed alsa Created 6 years, 2 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/mac/audio_low_latency_input_mac.cc ('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 4a56d3a6b1407321484b8c00c85b2cbe81f4cf6a..14ef242759a68d48db6da943ebb899b1089c3cf6 100644
--- a/media/audio/pulse/pulse_input.cc
+++ b/media/audio/pulse/pulse_input.cc
@@ -74,10 +74,6 @@ void PulseAudioInputStream::Start(AudioInputCallback* callback) {
if (stream_started_)
return;
- // Clean up the old buffer.
- pa_stream_drop(handle_);
- fifo_.Clear();
-
// Start the streaming.
callback_ = callback;
pa_stream_set_read_callback(handle_, &ReadCallback, this);
@@ -99,6 +95,10 @@ void PulseAudioInputStream::Stop() {
// Set the flag to false to stop filling new data to soundcard.
stream_started_ = false;
+ // Clean up the old buffer.
+ pa_stream_drop(handle_);
+ fifo_.Clear();
+
pa_operation* operation = pa_stream_flush(handle_,
&pulse::StreamSuccessCallback,
pa_mainloop_);
« no previous file with comments | « media/audio/mac/audio_low_latency_input_mac.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698