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

Unified Diff: remoting/protocol/webrtc_audio_module.cc

Issue 2650633003: Fix threading issues in the audio pipeline for WebRTC remoting protocol. (Closed)
Patch Set: . Created 3 years, 11 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 | « remoting/protocol/webrtc_audio_module.h ('k') | remoting/protocol/webrtc_audio_sink_adapter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/webrtc_audio_module.cc
diff --git a/remoting/protocol/webrtc_audio_module.cc b/remoting/protocol/webrtc_audio_module.cc
index fa2d15ec482c5b9f77e2fbf293a23096c50ac092..897b3199670de16a3d64d0bc4570432b8e66c00b 100644
--- a/remoting/protocol/webrtc_audio_module.cc
+++ b/remoting/protocol/webrtc_audio_module.cc
@@ -5,8 +5,10 @@
#include "remoting/protocol/webrtc_audio_module.h"
#include "base/bind.h"
+#include "base/memory/ptr_util.h"
#include "base/stl_util.h"
#include "base/threading/thread_task_runner_handle.h"
+#include "base/timer/timer.h"
namespace remoting {
namespace protocol {
@@ -502,14 +504,15 @@ int WebrtcAudioModule::GetRecordAudioParameters(
void WebrtcAudioModule::StartPlayoutOnAudioThread() {
DCHECK(audio_task_runner_->BelongsToCurrentThread());
- poll_timer_.Start(
+ poll_timer_ = base::MakeUnique<base::RepeatingTimer>();
+ poll_timer_->Start(
FROM_HERE, kPollInterval,
base::Bind(&WebrtcAudioModule::PollFromSource, base::Unretained(this)));
}
void WebrtcAudioModule::StopPlayoutOnAudioThread() {
DCHECK(audio_task_runner_->BelongsToCurrentThread());
- poll_timer_.Stop();
+ poll_timer_.reset();
}
void WebrtcAudioModule::PollFromSource() {
« no previous file with comments | « remoting/protocol/webrtc_audio_module.h ('k') | remoting/protocol/webrtc_audio_sink_adapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698