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

Unified Diff: remoting/host/audio_capturer_win.cc

Issue 10825368: Modified Windows buffer size to avoid audio glitches. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/audio_capturer_win.cc
diff --git a/remoting/host/audio_capturer_win.cc b/remoting/host/audio_capturer_win.cc
index b450a9a543e770582de73cfc94e0c95800b49e33..ce4c5f7c42da4ea34beaf3628eedfaff8260aa31 100644
--- a/remoting/host/audio_capturer_win.cc
+++ b/remoting/host/audio_capturer_win.cc
@@ -34,6 +34,11 @@ const int kHnsToMs = 10000;
// silence. A value of 2 was chosen, because Windows can give samples of 1 and
// -1, even when no audio is playing.
const int kSilenceThreshold = 2;
+
+// Number of packets that can be stored in the Windows capture buffer.
+// Even if we capture once every |audio_device_period_| * |kWindowsBufferSize|,
+// we will buffer enough to avoid glitches.
+const int kWindowsBufferSize = 10;
Wez 2012/08/15 21:32:29 Why 10? Surely we want to configure things to cope
kxing 2012/08/16 17:30:57 Done.
} // namespace
namespace remoting {
@@ -195,7 +200,7 @@ bool AudioCapturerWin::Start(const PacketCapturedCallback& callback) {
// Initialize the IAudioClient.
hr = audio_client_->Initialize(AUDCLNT_SHAREMODE_SHARED,
AUDCLNT_STREAMFLAGS_LOOPBACK,
- 0,
+ device_period * kWindowsBufferSize,
Sergey Ulanov 2012/08/15 21:43:22 Does this have to be multiple of device_period? Ca
kxing 2012/08/16 17:30:57 Done.
0,
wave_format_ex_,
NULL);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698