Ensure render time is zero when playout delay is zero so that minimal latency in the render pipeline is ensured.

Bug: webrtc:9135
Change-Id: Id9ae8ec59536808ba8923c73dd46abfe3fa6fe79
Reviewed-on: https://webrtc-review.googlesource.com/75600
Commit-Queue: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23309}
This commit is contained in:
Stefan Holmer
2018-05-15 13:00:10 +02:00
committed by Commit Bot
parent 6bf5a0d5b6
commit 812ceafb5a
3 changed files with 35 additions and 16 deletions

View File

@ -219,10 +219,14 @@ bool FrameBuffer::HasBadRenderTiming(const EncodedFrame& frame,
int64_t now_ms) {
// Assume that render timing errors are due to changes in the video stream.
int64_t render_time_ms = frame.RenderTimeMs();
const int64_t kMaxVideoDelayMs = 10000;
// Zero render time means render immediately.
if (render_time_ms == 0) {
return false;
}
if (render_time_ms < 0) {
return true;
}
const int64_t kMaxVideoDelayMs = 10000;
if (std::abs(render_time_ms - now_ms) > kMaxVideoDelayMs) {
int frame_delay = static_cast<int>(std::abs(render_time_ms - now_ms));
RTC_LOG(LS_WARNING)