From bb0aac27e3ade19ca24814c934f0e6bd795493fa Mon Sep 17 00:00:00 2001 From: Noah Richards Date: Wed, 13 Nov 2019 12:31:42 -0800 Subject: [PATCH] Reduce verbosity of logging around playout underrun count on iOS. This method is called on every GetStats call and fills up log output on iOS with three log lines per cycle at INFO+ (the not-supported one is LS_ERROR): [181:040] [82471] (audio_device_module_ios.mm:646): GetPlayoutUnderrunCount [181:040] [82471] (audio_device_generic.cc:48): GetPlayoutUnderrunCount: Not supported on this platform [181:040] [82471] (audio_device_module_ios.mm:649): output: -1 Alternatively, we could remove the error logging in the base class, or (better) log it once the first time it is called, but this is the simpler change. Bug: None Change-Id: Ibaa1d176f10cdc92f2ba1a6bf15aaa580da6edb4 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159672 Commit-Queue: Henrik Andreassson Reviewed-by: Henrik Andreassson Cr-Commit-Position: refs/heads/master@{#29797} --- sdk/objc/native/src/audio/audio_device_ios.h | 4 ++++ sdk/objc/native/src/audio/audio_device_module_ios.mm | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sdk/objc/native/src/audio/audio_device_ios.h b/sdk/objc/native/src/audio/audio_device_ios.h index 64fcf2c9e0..9d251724a5 100644 --- a/sdk/objc/native/src/audio/audio_device_ios.h +++ b/sdk/objc/native/src/audio/audio_device_ios.h @@ -82,6 +82,10 @@ class AudioDeviceIOS : public AudioDeviceGeneric, // the log by using these dummy implementations instead. int32_t PlayoutDelay(uint16_t& delayMS) const override; + // No implementation for playout underrun on iOS. We override it to avoid a + // periodic log that it isn't available from the base class. + int32_t GetPlayoutUnderrunCount() const override { return -1; } + // Native audio parameters stored during construction. // These methods are unique for the iOS implementation. int GetPlayoutAudioParameters(AudioParameters* params) const override; diff --git a/sdk/objc/native/src/audio/audio_device_module_ios.mm b/sdk/objc/native/src/audio/audio_device_module_ios.mm index 74d29651dd..fbfa88f9b9 100644 --- a/sdk/objc/native/src/audio/audio_device_module_ios.mm +++ b/sdk/objc/native/src/audio/audio_device_module_ios.mm @@ -643,10 +643,9 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS() } int32_t AudioDeviceModuleIOS::GetPlayoutUnderrunCount() const { - RTC_LOG(INFO) << __FUNCTION__; + // Don't log here, as this method can be called very often. CHECKinitialized_(); int32_t ok = audio_device_->GetPlayoutUnderrunCount(); - RTC_LOG(INFO) << "output: " << ok; return ok; }