Control combined_audio_video_bwe with config bool.

Permits setting RTP extensions for AudioReceiveStream without enabling
combined A/V BWE. This prevents spamming the log with "Failed to find
extension id:".

BUG=webrtc:4870
R=mflodman@webrtc.org, stefan@webrtc.org

Review URL: https://codereview.webrtc.org/1256803004

Cr-Original-Commit-Position: refs/heads/master@{#9633}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 6bb1b6e7fe5631e9f218b80292df5b64623c5616
diff --git a/audio_receive_stream.h b/audio_receive_stream.h
index 44e232c..9a8601d 100644
--- a/audio_receive_stream.h
+++ b/audio_receive_stream.h
@@ -59,6 +59,9 @@
     // Call::CreateReceiveStream().
     // TODO(solenberg): Use unique_ptr<> once our std lib fully supports C++11.
     std::map<uint8_t, AudioDecoder*> decoder_map;
+
+    // TODO(pbos): Remove config option once combined A/V BWE is always on.
+    bool combined_audio_video_bwe = false;
   };
 
   virtual Stats GetStats() const = 0;
diff --git a/video/audio_receive_stream.cc b/video/audio_receive_stream.cc
index 88fd431..9f8bebe 100644
--- a/video/audio_receive_stream.cc
+++ b/video/audio_receive_stream.cc
@@ -86,13 +86,15 @@
 
 bool AudioReceiveStream::DeliverRtp(const uint8_t* packet, size_t length) {
   RTPHeader header;
+
   if (!rtp_header_parser_->Parse(packet, length, &header)) {
     return false;
   }
 
-  // Only forward if the parsed header has absolute sender time. RTP time stamps
+  // Only forward if the parsed header has absolute sender time. RTP timestamps
   // may have different rates for audio and video and shouldn't be mixed.
-  if (header.extension.hasAbsoluteSendTime) {
+  if (config_.combined_audio_video_bwe &&
+      header.extension.hasAbsoluteSendTime) {
     int64_t arrival_time_ms = TickTime::MillisecondTimestamp();
     size_t payload_size = length - header.headerLength;
     remote_bitrate_estimator_->IncomingPacket(arrival_time_ms, payload_size,
diff --git a/video/bitrate_estimator_tests.cc b/video/bitrate_estimator_tests.cc
index 872fe44..cb6ef0e 100644
--- a/video/bitrate_estimator_tests.cc
+++ b/video/bitrate_estimator_tests.cc
@@ -210,6 +210,7 @@
         receive_config.voe_channel_id = 0;
         receive_config.rtp.extensions.push_back(
             RtpExtension(RtpExtension::kAbsSendTime, kASTExtensionId));
+        receive_config.combined_audio_video_bwe = true;
         audio_receive_stream_ = test_->receiver_call_->CreateAudioReceiveStream(
             receive_config);
       } else {