Fix low-latency renderer with unset playout delays
The low-latency renderer is activated by the RTP header extension
playout-delay if the min value is set to 0 and the max value is
set to something greater than 0.
According to the specification of the playout-delay header
extension it doesn't have to be set for every frame but only if
it is changed. The bug that this CL fixes occured if a playout
delay had been set previously but some frames without any specified
playout-delay were received. In this case max composition delay
would not be set and the low-latency renderer algorithm would be
disabled for the rest of the session.
Bug: chromium:1138888
Change-Id: I12d10715fd5ec29f6ee78296ddfe975d7edab8a9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208581
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33330}
diff --git a/modules/video_coding/generic_decoder.cc b/modules/video_coding/generic_decoder.cc
index 28c97f0..3d48a3e 100644
--- a/modules/video_coding/generic_decoder.cc
+++ b/modules/video_coding/generic_decoder.cc
@@ -110,8 +110,7 @@
decodedImage.set_packet_infos(frameInfo->packet_infos);
decodedImage.set_rotation(frameInfo->rotation);
- if (low_latency_renderer_enabled_ && frameInfo->playout_delay.min_ms == 0 &&
- frameInfo->playout_delay.max_ms > 0) {
+ if (low_latency_renderer_enabled_) {
absl::optional<int> max_composition_delay_in_frames =
_timing->MaxCompositionDelayInFrames();
if (max_composition_delay_in_frames) {
@@ -253,7 +252,6 @@
_frameInfos[_nextFrameInfoIdx].decodeStart = now;
_frameInfos[_nextFrameInfoIdx].renderTimeMs = frame.RenderTimeMs();
_frameInfos[_nextFrameInfoIdx].rotation = frame.rotation();
- _frameInfos[_nextFrameInfoIdx].playout_delay = frame.PlayoutDelay();
_frameInfos[_nextFrameInfoIdx].timing = frame.video_timing();
_frameInfos[_nextFrameInfoIdx].ntp_time_ms =
frame.EncodedImage().ntp_time_ms_;
diff --git a/modules/video_coding/generic_decoder.h b/modules/video_coding/generic_decoder.h
index ea9f114..b595323 100644
--- a/modules/video_coding/generic_decoder.h
+++ b/modules/video_coding/generic_decoder.h
@@ -35,7 +35,6 @@
void* userData;
VideoRotation rotation;
VideoContentType content_type;
- PlayoutDelay playout_delay;
EncodedImage::Timing timing;
int64_t ntp_time_ms;
RtpPacketInfos packet_infos;