Make Frame buffer not drop frames unnecessary

Now VCMTiming::MaxWaitingTime will not clip negative values. Thus frame
buffer will be able to distinguish between late frames and when waiting
cycle was simply interrupted by a new inserted frame right before the
waiting timer would expire.

Bug: webrtc:8917
Change-Id: I6b253f459fcb3a346064a103cc92ee332b074e1b
Reviewed-on: https://webrtc-review.googlesource.com/57741
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22210}
This commit is contained in:
Ilya Nikolaevskiy
2018-02-27 15:49:47 +01:00
committed by Commit Bot
parent 99a2c5dcb6
commit 8c4fe16e4c
5 changed files with 20 additions and 16 deletions

View File

@ -234,17 +234,14 @@ int VCMTiming::RequiredDecodeTimeMs() const {
return decode_time_ms;
}
uint32_t VCMTiming::MaxWaitingTime(int64_t render_time_ms,
int64_t now_ms) const {
int64_t VCMTiming::MaxWaitingTime(int64_t render_time_ms,
int64_t now_ms) const {
rtc::CritScope cs(&crit_sect_);
const int64_t max_wait_time_ms =
render_time_ms - now_ms - RequiredDecodeTimeMs() - render_delay_ms_;
if (max_wait_time_ms < 0) {
return 0;
}
return static_cast<uint32_t>(max_wait_time_ms);
return max_wait_time_ms;
}
int VCMTiming::TargetVideoDelay() const {