Reset the delay-based estimate before forcing a new loss-based send rate.

Without this fix the new estimate would be capped by the old delay-based
estimate. Also revert a part of https://codereview.webrtc.org/2949203002
that only pushes updates from the delay-based estimate if the estimate
change. This is reverted as a safety precaution to prevent situations
where the two estimators get out of sync.

Bug: webrtc:8495
Change-Id: I153f2af4a822e67d47c52bffc97a73ab931a15dd
Reviewed-on: https://webrtc-review.googlesource.com/20981
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20614}
diff --git a/modules/bitrate_controller/bitrate_controller_impl.cc b/modules/bitrate_controller/bitrate_controller_impl.cc
index 1a51dec..c7fe322 100644
--- a/modules/bitrate_controller/bitrate_controller_impl.cc
+++ b/modules/bitrate_controller/bitrate_controller_impl.cc
@@ -147,11 +147,13 @@
     return;
   {
     rtc::CritScope cs(&critsect_);
-    bandwidth_estimation_.UpdateDelayBasedEstimate(clock_->TimeInMilliseconds(),
-                                                   result.target_bitrate_bps);
     if (result.probe) {
       bandwidth_estimation_.SetSendBitrate(result.target_bitrate_bps);
     }
+    // Since SetSendBitrate now resets the delay-based estimate, we have to call
+    // UpdateDelayBasedEstimate after SetSendBitrate.
+    bandwidth_estimation_.UpdateDelayBasedEstimate(clock_->TimeInMilliseconds(),
+                                                   result.target_bitrate_bps);
   }
   MaybeTriggerOnNetworkChanged();
 }