Fixing integer underflow in FileAudioDevice (webrtc issue 4554)
Problem is described here: https://code.google.com/p/webrtc/issues/detail?id=4554 Review URL: https://codereview.webrtc.org/1295603002 Cr-Commit-Position: refs/heads/master@{#11174}
This commit is contained in:
1
AUTHORS
1
AUTHORS
@ -32,6 +32,7 @@ Silviu Caragea <silviu.cpp@gmail.com>
|
|||||||
Steve Reid <sreid@sea-to-sky.net>
|
Steve Reid <sreid@sea-to-sky.net>
|
||||||
Vicken Simonian <vsimon@gmail.com>
|
Vicken Simonian <vsimon@gmail.com>
|
||||||
Victor Costan <costan@gmail.com>
|
Victor Costan <costan@gmail.com>
|
||||||
|
Alexander Brauckmann <a.brauckmann@gmail.com>
|
||||||
|
|
||||||
&yet LLC
|
&yet LLC
|
||||||
Agora IO
|
Agora IO
|
||||||
|
|||||||
@ -500,7 +500,12 @@ bool FileAudioDevice::PlayThreadProcess()
|
|||||||
}
|
}
|
||||||
_playoutFramesLeft = 0;
|
_playoutFramesLeft = 0;
|
||||||
_critSect.Leave();
|
_critSect.Leave();
|
||||||
SleepMs(10 - (_clock->CurrentNtpInMilliseconds() - currentTime));
|
|
||||||
|
uint64_t deltaTimeMillis = _clock->CurrentNtpInMilliseconds() - currentTime;
|
||||||
|
if(deltaTimeMillis < 10) {
|
||||||
|
SleepMs(10 - deltaTimeMillis);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -530,7 +535,12 @@ bool FileAudioDevice::RecThreadProcess()
|
|||||||
}
|
}
|
||||||
|
|
||||||
_critSect.Leave();
|
_critSect.Leave();
|
||||||
SleepMs(10 - (_clock->CurrentNtpInMilliseconds() - currentTime));
|
|
||||||
|
uint64_t deltaTimeMillis = _clock->CurrentNtpInMilliseconds() - currentTime;
|
||||||
|
if(deltaTimeMillis < 10) {
|
||||||
|
SleepMs(10 - deltaTimeMillis);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user