Add more sanity checks to workaround the unidentified problem that CaptureThread is still running while related resouces are destroyed already.
BUG= TEST=auto test R=henrika@webrtc.org Review URL: https://webrtc-codereview.appspot.com/28859004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@7590 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
ed45896759
commit
bf09976e86
@ -3893,6 +3893,12 @@ DWORD AudioDeviceWindowsCore::DoCaptureThread()
|
||||
// This value is fixed during the capturing session.
|
||||
//
|
||||
UINT32 bufferLength = 0;
|
||||
if (_ptrClientIn == NULL)
|
||||
{
|
||||
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
|
||||
"input state has been modified before capture loop starts.");
|
||||
return 1;
|
||||
}
|
||||
hr = _ptrClientIn->GetBufferSize(&bufferLength);
|
||||
EXIT_ON_ERROR(hr);
|
||||
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "[CAPT] size of buffer : %u", bufferLength);
|
||||
@ -4113,7 +4119,10 @@ DWORD AudioDeviceWindowsCore::DoCaptureThread()
|
||||
|
||||
// ---------------------------- THREAD LOOP ---------------------------- <<
|
||||
|
||||
if (_ptrClientIn)
|
||||
{
|
||||
hr = _ptrClientIn->Stop();
|
||||
}
|
||||
|
||||
Exit:
|
||||
if (FAILED(hr))
|
||||
|
Loading…
Reference in New Issue
Block a user