Query the capture volume immediately on Win Core.
This allows the capture volume to be queried immediately at capture startup, rather than waiting the usual one second interval. Review URL: http://webrtc-codereview.appspot.com/297003 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1064 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
524eb48081
commit
587c844741
@ -3354,20 +3354,6 @@ DWORD AudioDeviceWindowsCore::DoGetCaptureVolumeThread()
|
||||
|
||||
while (1)
|
||||
{
|
||||
DWORD waitResult = WaitForSingleObject(waitObject,
|
||||
GET_MIC_VOLUME_INTERVAL_MS);
|
||||
switch (waitResult)
|
||||
{
|
||||
case WAIT_OBJECT_0: // _hShutdownCaptureEvent
|
||||
return 0;
|
||||
case WAIT_TIMEOUT: // timeout notification
|
||||
break;
|
||||
default: // unexpected error
|
||||
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
|
||||
" unknown wait termination on get volume thread");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (AGC())
|
||||
{
|
||||
WebRtc_UWord32 currentMicLevel = 0;
|
||||
@ -3382,6 +3368,20 @@ DWORD AudioDeviceWindowsCore::DoGetCaptureVolumeThread()
|
||||
_UnLock();
|
||||
}
|
||||
}
|
||||
|
||||
DWORD waitResult = WaitForSingleObject(waitObject,
|
||||
GET_MIC_VOLUME_INTERVAL_MS);
|
||||
switch (waitResult)
|
||||
{
|
||||
case WAIT_OBJECT_0: // _hShutdownCaptureEvent
|
||||
return 0;
|
||||
case WAIT_TIMEOUT: // timeout notification
|
||||
break;
|
||||
default: // unexpected error
|
||||
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
|
||||
" unknown wait termination on get volume thread");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3394,11 +3394,11 @@ DWORD AudioDeviceWindowsCore::DoSetCaptureVolumeThread()
|
||||
DWORD waitResult = WaitForMultipleObjects(2, waitArray, FALSE, INFINITE);
|
||||
switch (waitResult)
|
||||
{
|
||||
case WAIT_OBJECT_0: // _hShutdownCaptureEvent
|
||||
case WAIT_OBJECT_0: // _hShutdownCaptureEvent
|
||||
return 0;
|
||||
case WAIT_OBJECT_0 + 1: // _hSetCaptureVolumeEvent
|
||||
case WAIT_OBJECT_0 + 1: // _hSetCaptureVolumeEvent
|
||||
break;
|
||||
default: // unexpected error
|
||||
default: // unexpected error
|
||||
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
|
||||
" unknown wait termination on set volume thread");
|
||||
return -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user