Fix some instances of -Wunused-but-set-variable.

Bug: chromium:1203071
Change-Id: I1ef3c8fd1f8e2bbf980d5d5217257e919f4564c2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226961
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34579}
diff --git a/modules/audio_coding/neteq/test/neteq_decoding_test.cc b/modules/audio_coding/neteq/test/neteq_decoding_test.cc
index 11b1b1a..d7f414a 100644
--- a/modules/audio_coding/neteq/test/neteq_decoding_test.cc
+++ b/modules/audio_coding/neteq/test/neteq_decoding_test.cc
@@ -222,7 +222,6 @@
   const int kSamples = kBlockSize16kHz * kBlocksPerFrame;
   const size_t kPayloadBytes = kSamples * sizeof(int16_t);
   double next_input_time_ms = 0.0;
-  uint32_t receive_timestamp = 0;
 
   // Insert speech for 2 seconds.
   const int kSpeechDurationMs = 2000;
@@ -260,7 +259,6 @@
 
       ++seq_no;
       timestamp += kSamples;
-      receive_timestamp += kSamples;
       next_input_time_ms += static_cast<double>(kFrameSizeMs);
 
       seq_no_wrapped |= seq_no < last_seq_no;
diff --git a/modules/audio_processing/agc/legacy/digital_agc.cc b/modules/audio_processing/agc/legacy/digital_agc.cc
index 185e849..e0c0766 100644
--- a/modules/audio_processing/agc/legacy/digital_agc.cc
+++ b/modules/audio_processing/agc/legacy/digital_agc.cc
@@ -79,10 +79,9 @@
   uint16_t constMaxGain;
   uint16_t tmpU16, intPart, fracPart;
   const int16_t kCompRatio = 3;
-  const int16_t kSoftLimiterLeft = 1;
   int16_t limiterOffset = 0;  // Limiter offset
   int16_t limiterIdx, limiterLvlX;
-  int16_t constLinApprox, zeroGainLvl, maxGain, diffGain;
+  int16_t constLinApprox, maxGain, diffGain;
   int16_t i, tmp16, tmp16no1;
   int zeros, zerosScale;
 
@@ -98,17 +97,11 @@
       WebRtcSpl_DivW32W16ResW16(tmp32no1 + (kCompRatio >> 1), kCompRatio);
   maxGain = WEBRTC_SPL_MAX(tmp16no1, (analogTarget - targetLevelDbfs));
   tmp32no1 = maxGain * kCompRatio;
-  zeroGainLvl = digCompGaindB;
-  zeroGainLvl -= WebRtcSpl_DivW32W16ResW16(tmp32no1 + ((kCompRatio - 1) >> 1),
-                                           kCompRatio - 1);
   if ((digCompGaindB <= analogTarget) && (limiterEnable)) {
-    zeroGainLvl += (analogTarget - digCompGaindB + kSoftLimiterLeft);
     limiterOffset = 0;
   }
 
-  // Calculate the difference between maximum gain and gain at 0dB0v:
-  //  diffGain = maxGain + (compRatio-1)*zeroGainLvl/compRatio
-  //           = (compRatio-1)*digCompGaindB/compRatio
+  // Calculate the difference between maximum gain and gain at 0dB0v
   tmp32no1 = digCompGaindB * (kCompRatio - 1);
   diffGain =
       WebRtcSpl_DivW32W16ResW16(tmp32no1 + (kCompRatio >> 1), kCompRatio);
@@ -294,15 +287,12 @@
   int16_t gate, gain_adj;
   int16_t k;
   size_t n, L;
-  int16_t L2;  // samples/subframe
 
   // determine number of samples per ms
   if (FS == 8000) {
     L = 8;
-    L2 = 3;
   } else if (FS == 16000 || FS == 32000 || FS == 48000) {
     L = 16;
-    L2 = 4;
   } else {
     return -1;
   }
diff --git a/test/fake_encoder.cc b/test/fake_encoder.cc
index 814be28..04ce66b 100644
--- a/test/fake_encoder.cc
+++ b/test/fake_encoder.cc
@@ -95,7 +95,6 @@
   SpatialLayer simulcast_streams[kMaxSimulcastStreams];
   EncodedImageCallback* callback;
   RateControlParameters rates;
-  VideoCodecMode mode;
   bool keyframe;
   uint32_t counter;
   absl::optional<int> qp;
@@ -108,7 +107,6 @@
     }
     callback = callback_;
     rates = current_rate_settings_;
-    mode = config_.mode;
     if (rates.framerate_fps <= 0.0) {
       rates.framerate_fps = max_framerate;
     }
diff --git a/video/video_stream_encoder.cc b/video/video_stream_encoder.cc
index 68aae28..dc47167 100644
--- a/video/video_stream_encoder.cc
+++ b/video/video_stream_encoder.cc
@@ -1827,6 +1827,9 @@
     const CodecSpecificInfo* codec_specific_info) {
   TRACE_EVENT_INSTANT1("webrtc", "VCMEncodedFrameCallback::Encoded",
                        "timestamp", encoded_image.Timestamp());
+
+  // TODO(bugs.webrtc.org/10520): Signal the simulcast id explicitly.
+
   const size_t spatial_idx = encoded_image.SpatialIndex().value_or(0);
   EncodedImage image_copy(encoded_image);
 
@@ -1896,18 +1899,6 @@
   // running in parallel on different threads.
   encoder_stats_observer_->OnSendEncodedImage(image_copy, codec_specific_info);
 
-  // The simulcast id is signaled in the SpatialIndex. This makes it impossible
-  // to do simulcast for codecs that actually support spatial layers since we
-  // can't distinguish between an actual spatial layer and a simulcast stream.
-  // TODO(bugs.webrtc.org/10520): Signal the simulcast id explicitly.
-  int simulcast_id = 0;
-  if (codec_specific_info &&
-      (codec_specific_info->codecType == kVideoCodecVP8 ||
-       codec_specific_info->codecType == kVideoCodecH264 ||
-       codec_specific_info->codecType == kVideoCodecGeneric)) {
-    simulcast_id = encoded_image.SpatialIndex().value_or(0);
-  }
-
   EncodedImageCallback::Result result =
       sink_->OnEncodedImage(image_copy, codec_specific_info);