Fix stop logging errors for stereo mode when it is not used

When using WebRTC in iOS this Warning is shown for every single call even if stereo is not being used at all.

Change-Id: I0cc71620b9deb0692544101d78c0801968edbb26

Bug: webrtc:10146
Change-Id: I0cc71620b9deb0692544101d78c0801968edbb26
Reviewed-on: https://webrtc-review.googlesource.com/c/85283
Commit-Queue: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26133}
diff --git a/modules/audio_device/audio_device_impl.cc b/modules/audio_device/audio_device_impl.cc
index 31d5b5e..c5f4332 100644
--- a/modules/audio_device/audio_device_impl.cc
+++ b/modules/audio_device/audio_device_impl.cc
@@ -548,11 +548,14 @@
   RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
   CHECKinitialized_();
   if (audio_device_->RecordingIsInitialized()) {
-    RTC_LOG(WARNING) << "recording in stereo is not supported";
+    RTC_LOG(LERROR)
+        << "unable to set stereo mode after recording is initialized";
     return -1;
   }
   if (audio_device_->SetStereoRecording(enable) == -1) {
-    RTC_LOG(WARNING) << "failed to change stereo recording";
+    if (enable) {
+      RTC_LOG(WARNING) << "failed to enable stereo recording";
+    }
     return -1;
   }
   int8_t nChannels(1);
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 176b51a..814ab90 100644
--- a/sdk/objc/native/src/audio/audio_device_module_ios.mm
+++ b/sdk/objc/native/src/audio/audio_device_module_ios.mm
@@ -287,20 +287,10 @@
   int32_t AudioDeviceModuleIOS::SetStereoRecording(bool enable) {
     RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
     CHECKinitialized_();
-    if (audio_device_->RecordingIsInitialized()) {
-      RTC_LOG(WARNING) << "recording in stereo is not supported";
-      return -1;
-    }
-    if (audio_device_->SetStereoRecording(enable) == -1) {
-      RTC_LOG(WARNING) << "failed to change stereo recording";
-      return -1;
-    }
-    int8_t nChannels(1);
     if (enable) {
-      nChannels = 2;
+      RTC_LOG(WARNING) << "recording in stereo is not supported";
     }
-    audio_device_buffer_.get()->SetRecordingChannels(nChannels);
-    return 0;
+    return -1;
   }
 
   int32_t AudioDeviceModuleIOS::StereoRecording(bool* enabled) const {