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);
// 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_);