Adding some error handling functionality in the windows audio core implementation to

stop rendering automatically and throw a playout-error callback when RequestPlayoutData
fails
Review URL: http://webrtc-codereview.appspot.com/300003

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1080 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
punyabrata@webrtc.org 2011-12-01 17:55:35 +00:00
parent c6182915a3
commit c1ed87602a

View File

@ -3592,9 +3592,18 @@ DWORD AudioDeviceWindowsCore::DoRenderThread()
{
// Request data to be played out (#bytes = _playBlockSize*_audioFrameSize)
_UnLock();
WebRtc_UWord32 nSamples = _ptrAudioBuffer->RequestPlayoutData(_playBlockSize);
WebRtc_Word32 nSamples =
_ptrAudioBuffer->RequestPlayoutData(_playBlockSize);
_Lock();
if (nSamples == -1)
{
_UnLock();
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id,
"failed to read data from render client");
goto Exit;
}
// Sanity check to ensure that essential states are not modified during the unlocked period
if (_ptrRenderClient == NULL || _ptrClientOut == NULL)
{