Make AV sync robust to failures to set a desired minimum delay

Setting a minimum delay can fail in some cases. It is important that the
AV sync code is aware of failures and can act accordingly to recover and
prevent sync delays that keep increasing indefinitely.

Bug: webrtc:11805
Change-Id: I0deed951dc6c6d0905536a949af875e0a6d9f7fa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183360
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32062}
diff --git a/video/stream_synchronization.cc b/video/stream_synchronization.cc
index 8c808f1..d5c77c1 100644
--- a/video/stream_synchronization.cc
+++ b/video/stream_synchronization.cc
@@ -184,4 +184,12 @@
   base_target_delay_ms_ = target_delay_ms;
 }
 
+void StreamSynchronization::ReduceAudioDelay() {
+  audio_delay_.extra_ms *= 0.9f;
+}
+
+void StreamSynchronization::ReduceVideoDelay() {
+  video_delay_.extra_ms *= 0.9f;
+}
+
 }  // namespace webrtc