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

Unified Diff: webrtc/modules/audio_device/win/audio_device_core_win.cc

Issue 2876593003: Fix audio device excessive logging on Windows (Closed)
Patch Set: fix format Created 3 years, 7 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 | « webrtc/modules/audio_device/win/audio_device_core_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_device/win/audio_device_core_win.cc
diff --git a/webrtc/modules/audio_device/win/audio_device_core_win.cc b/webrtc/modules/audio_device/win/audio_device_core_win.cc
index 9d1d5322fb16833d77b4df44a6d5675517906d8e..b4bb8f9c24b440feb11d25ca134cd4d1169a8d1b 100644
--- a/webrtc/modules/audio_device/win/audio_device_core_win.cc
+++ b/webrtc/modules/audio_device/win/audio_device_core_win.cc
@@ -424,6 +424,7 @@ AudioDeviceWindowsCore::AudioDeviceWindowsCore(const int32_t id) :
_builtInAecEnabled(false),
_playAudioFrameSize(0),
_playSampleRate(0),
+ _playBlockSizePerChannel(0),
_playBlockSize(0),
_playChannels(2),
_sndCardPlayDelay(0),
@@ -2282,7 +2283,8 @@ int32_t AudioDeviceWindowsCore::InitPlayout()
if (hr == S_OK)
{
_playAudioFrameSize = Wfx.nBlockAlign;
- _playBlockSize = Wfx.nSamplesPerSec/100;
+ _playBlockSizePerChannel = Wfx.nSamplesPerSec/100;
+ _playBlockSize = _playBlockSizePerChannel*Wfx.nChannels;
_playSampleRate = Wfx.nSamplesPerSec;
_devicePlaySampleRate = Wfx.nSamplesPerSec; // The device itself continues to run at 44.1 kHz.
_devicePlayBlockSize = Wfx.nSamplesPerSec/100;
@@ -3565,7 +3567,8 @@ DWORD AudioDeviceWindowsCore::DoRenderThread()
// Request data to be played out (#bytes = _playBlockSize*_audioFrameSize)
_UnLock();
int32_t nSamples =
- _ptrAudioBuffer->RequestPlayoutData(_playBlockSize);
+ _ptrAudioBuffer->RequestPlayoutData(
+ _playBlockSizePerChannel);
_Lock();
if (nSamples == -1)
« no previous file with comments | « webrtc/modules/audio_device/win/audio_device_core_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698