Skip to content

Commit

Permalink
Change type of kIntervalBetweenVolumeUpdatesMs from int to TimeDelta
Browse files Browse the repository at this point in the history
Change-Id: Id1485386e91a5936074b1caf17b18a789eb07fd1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3825929
Reviewed-by: Olga Sharonova <olka@chromium.org>
Commit-Queue: Fredrik Hernqvist <fhernqvist@google.com>
Cr-Commit-Position: refs/heads/main@{#1034995}
  • Loading branch information
Fredrik Hernqvist authored and Chromium LUCI CQ committed Aug 15, 2022
1 parent 9ae72ef commit 2e45a3a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions media/audio/agc_audio_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ template <typename AudioInterface>
class MEDIA_EXPORT AgcAudioStream : public AudioInterface {
public:
// Time between two successive timer events.
static const int kIntervalBetweenVolumeUpdatesMs = 1000;
static constexpr base::TimeDelta kIntervalBetweenVolumeUpdates =
base::Milliseconds(1000);

AgcAudioStream()
: agc_is_enabled_(false), max_volume_(0.0), normalized_volume_(0.0) {
Expand Down Expand Up @@ -103,8 +104,8 @@ class MEDIA_EXPORT AgcAudioStream : public AudioInterface {
// volume from 0.
QueryAndStoreNewMicrophoneVolume();

timer_.Start(FROM_HERE, base::Milliseconds(kIntervalBetweenVolumeUpdatesMs),
this, &AgcAudioStream::QueryAndStoreNewMicrophoneVolume);
timer_.Start(FROM_HERE, kIntervalBetweenVolumeUpdates, this,
&AgcAudioStream::QueryAndStoreNewMicrophoneVolume);
}

// Stops the periodic timer which periodically checks and updates the
Expand Down

0 comments on commit 2e45a3a

Please sign in to comment.