summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--remoting/host/audio_capturer_linux.cc9
-rw-r--r--remoting/host/remoting_me2me_host.cc8
2 files changed, 15 insertions, 2 deletions
diff --git a/remoting/host/audio_capturer_linux.cc b/remoting/host/audio_capturer_linux.cc
index 0ad38a6..d8cb548 100644
--- a/remoting/host/audio_capturer_linux.cc
+++ b/remoting/host/audio_capturer_linux.cc
@@ -22,11 +22,16 @@ base::LazyInstance<scoped_refptr<AudioPipeReader> >::Leaky
} // namespace
+// TODO(wez): Remove this and have the DesktopEnvironmentFactory own the
+// AudioPipeReader rather than having it process-global.
+// See crbug.com/161373 and crbug.com/104544.
void AudioCapturerLinux::InitializePipeReader(
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
const FilePath& pipe_name) {
- g_pulseaudio_pipe_sink_reader.Get() =
- AudioPipeReader::Create(task_runner, pipe_name);
+ scoped_refptr<AudioPipeReader> pipe_reader;
+ if (!pipe_name.empty())
+ pipe_reader = AudioPipeReader::Create(task_runner, pipe_name);
+ g_pulseaudio_pipe_sink_reader.Get() = pipe_reader;
}
AudioCapturerLinux::AudioCapturerLinux(
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc
index 01ff3bb..1672317 100644
--- a/remoting/host/remoting_me2me_host.cc
+++ b/remoting/host/remoting_me2me_host.cc
@@ -611,6 +611,14 @@ void HostProcess::ShutdownOnUiThread() {
// It is now safe for the HostProcess to be deleted.
self_ = NULL;
+
+#if defined(OS_LINUX)
+ // Cause the global AudioPipeReader to be freed, otherwise the audio
+ // thread will remain in-use and prevent the process from exiting.
+ // TODO(wez): DesktopEnvironmentFactory should own the pipe reader.
+ // See crbug.com/161373 and crbug.com/104544.
+ AudioCapturerLinux::InitializePipeReader(NULL, FilePath());
+#endif
}
// Overridden from HeartbeatSender::Listener