Index: webrtc/modules/video_coding/frame_buffer2.cc |
diff --git a/webrtc/modules/video_coding/frame_buffer2.cc b/webrtc/modules/video_coding/frame_buffer2.cc |
index 4dcea53f6a6b4a0e993e5da827ea6a24fb531c9b..35f023784c17edd4930d530ad3e83100cbe984e2 100644 |
--- a/webrtc/modules/video_coding/frame_buffer2.cc |
+++ b/webrtc/modules/video_coding/frame_buffer2.cc |
@@ -207,6 +207,21 @@ void FrameBuffer::Stop() { |
new_continuous_frame_event_.Set(); |
} |
+void FrameBuffer::UpdatePlayoutDelays(const FrameObject& frame) { |
+ TRACE_EVENT0("webrtc", "FrameBuffer::UpdatePlayoutDelays"); |
+ int minimal_playout_delay_ms = -1; |
+ int maximal_playout_delay_ms = -1; |
sprang_webrtc
2017/05/10 13:58:10
No need to initialize these temporaries. In fact,
|
+ |
+ minimal_playout_delay_ms = frame.EncodedImage().playout_delay_.min_ms; |
+ maximal_playout_delay_ms = frame.EncodedImage().playout_delay_.max_ms; |
+ |
+ if (minimal_playout_delay_ms >= 0) |
+ timing_->set_min_playout_delay(minimal_playout_delay_ms); |
+ |
+ if (maximal_playout_delay_ms >= 0) |
+ timing_->set_max_playout_delay(maximal_playout_delay_ms); |
+} |
+ |
int FrameBuffer::InsertFrame(std::unique_ptr<FrameObject> frame) { |
TRACE_EVENT0("webrtc", "FrameBuffer::InsertFrame"); |
RTC_DCHECK(frame); |
@@ -283,7 +298,7 @@ int FrameBuffer::InsertFrame(std::unique_ptr<FrameObject> frame) { |
if (!UpdateFrameInfoWithIncomingFrame(*frame, info)) |
return last_continuous_picture_id; |
- |
+ UpdatePlayoutDelays(*frame); |
info->second.frame = std::move(frame); |
++num_frames_buffered_; |