Compile audio_device without -Wno-global-constructors.

This CL removes kNumMicrosecsPerSec and kNumMillisecsPerSec from
modules/audio_device/win/core_audio_utility_win.h.

kNumMillisecsPerSec was unused, while kNumMicrosecsPerSec has been
replaced by rtc::kNumMicrosecsPerSec.

Bug: webrtc:9693
Change-Id: I560aa9dad2bfb94a9bf67d3b9941700f1948086b
Reviewed-on: https://webrtc-review.googlesource.com/102860
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24906}
This commit is contained in:
Mirko Bonadei
2018-10-01 10:14:44 +02:00
committed by Commit Bot
parent 35fa280229
commit 4f340fa01e
3 changed files with 4 additions and 6 deletions

View File

@ -147,7 +147,6 @@ rtc_source_set("audio_device_name") {
}
rtc_source_set("windows_core_audio_utility") {
public_configs = [ "../..:no_global_constructors" ]
if (is_win && !build_with_chromium) {
sources = [
"win/core_audio_utility_win.cc",

View File

@ -16,6 +16,7 @@
#include "rtc_base/bind.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include "rtc_base/timeutils.h"
using Microsoft::WRL::ComPtr;
@ -359,8 +360,9 @@ int CoreAudioOutput::EstimateOutputLatencyMillis(uint64_t device_frequency) {
const uint64_t delay_frames = num_frames_written_ - num_played_out_frames;
// Convert latency in number of frames into milliseconds.
webrtc::TimeDelta delay = webrtc::TimeDelta::us(
delay_frames * kNumMicrosecsPerSec / format_.Format.nSamplesPerSec);
webrtc::TimeDelta delay =
webrtc::TimeDelta::us(delay_frames * rtc::kNumMicrosecsPerSec /
format_.Format.nSamplesPerSec);
delay_ms = delay.ms();
}
return delay_ms;

View File

@ -32,9 +32,6 @@
namespace webrtc {
namespace webrtc_win {
static const int64_t kNumMicrosecsPerSec = webrtc::TimeDelta::seconds(1).us();
static const int64_t kNumMillisecsPerSec = webrtc::TimeDelta::seconds(1).ms();
// Utility class which registers a thread with MMCSS in the constructor and
// deregisters MMCSS in the destructor. The task name is given by |task_name|.
// The Multimedia Class Scheduler service (MMCSS) enables multimedia