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

Unified Diff: webrtc/modules/audio_device/dummy/file_audio_device.cc

Issue 1295603002: Fixing integer underflow in FileAudioDevice (webrtc issue 4554) (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 4 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 | « AUTHORS ('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/dummy/file_audio_device.cc
diff --git a/webrtc/modules/audio_device/dummy/file_audio_device.cc b/webrtc/modules/audio_device/dummy/file_audio_device.cc
index 3de5344a8f151a81540e57ca2bc7b25b5305c131..e4547c423c964e0f31c7ab8c8eede369a81b1984 100644
--- a/webrtc/modules/audio_device/dummy/file_audio_device.cc
+++ b/webrtc/modules/audio_device/dummy/file_audio_device.cc
@@ -514,7 +514,12 @@ bool FileAudioDevice::PlayThreadProcess()
}
_playoutFramesLeft = 0;
_critSect.Leave();
- SleepMs(10 - (_clock->CurrentNtpInMilliseconds() - currentTime));
+
+ uint64_t deltaTimeMillis = _clock->CurrentNtpInMilliseconds() - currentTime;
+ if(deltaTimeMillis < 10) {
phoglund 2015/11/19 14:17:37 Nit: space between if and (.
+ SleepMs(10 - deltaTimeMillis);
+ }
+
return true;
}
@@ -544,7 +549,12 @@ bool FileAudioDevice::RecThreadProcess()
}
_critSect.Leave();
- SleepMs(10 - (_clock->CurrentNtpInMilliseconds() - currentTime));
+
+ uint64_t deltaTimeMillis = _clock->CurrentNtpInMilliseconds() - currentTime;
+ if(deltaTimeMillis < 10) {
phoglund 2015/11/19 14:17:37 Nit: ditto
+ SleepMs(10 - deltaTimeMillis);
+ }
+
return true;
}
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698