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

Side by Side Diff: webrtc/modules/audio_device/ios/audio_device_ios.mm

Issue 1265823003: Fix a bug in computing audio delay on ios device. Converts seconds to (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 unified diff | Download patch
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 OSStatus result = 910 OSStatus result =
911 AudioUnitGetProperty(_auVoiceProcessing, kAudioUnitProperty_Latency, 911 AudioUnitGetProperty(_auVoiceProcessing, kAudioUnitProperty_Latency,
912 kAudioUnitScope_Global, 0, &f64, &size); 912 kAudioUnitScope_Global, 0, &f64, &size);
913 if (0 != result) { 913 if (0 != result) {
914 LOG_F(LS_ERROR) << "AU latency error: " << result; 914 LOG_F(LS_ERROR) << "AU latency error: " << result;
915 } 915 }
916 assert(f64 >= 0); 916 assert(f64 >= 0);
917 totalDelaySeconds += f64; 917 totalDelaySeconds += f64;
918 918
919 // To ms 919 // To ms
920 _playoutDelay = static_cast<uint32_t>(totalDelaySeconds / 1000); 920 _playoutDelay = static_cast<uint32_t>(totalDelaySeconds * 1000);
921 921
922 // Reset counter 922 // Reset counter
923 _playoutDelayMeasurementCounter = 0; 923 _playoutDelayMeasurementCounter = 0;
924 } 924 }
925 925
926 // todo: Add playout buffer? 926 // todo: Add playout buffer?
927 } 927 }
928 928
929 void AudioDeviceIOS::UpdateRecordingDelay() { 929 void AudioDeviceIOS::UpdateRecordingDelay() {
930 ++_recordingDelayMeasurementCounter; 930 ++_recordingDelayMeasurementCounter;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1045 // Device Buffer? 1045 // Device Buffer?
1046 timespec t; 1046 timespec t;
1047 t.tv_sec = 0; 1047 t.tv_sec = 0;
1048 t.tv_nsec = 5 * 1000 * 1000; 1048 t.tv_nsec = 5 * 1000 * 1000;
1049 nanosleep(&t, nullptr); 1049 nanosleep(&t, nullptr);
1050 } 1050 }
1051 return true; 1051 return true;
1052 } 1052 }
1053 1053
1054 } // namespace webrtc 1054 } // namespace webrtc
OLDNEW
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698