Mitigate scenario when VP9 HW encoder uses less spatial layers than configured

log an error and reset chain instead of propagating oversized chain diff, thus avoid DCHECK in RtpDependencyDescriptorWriter.

Bug: webrtc:11999, chromium:1467865
Change-Id: If0d186ce7d3a108799ef2b42dd4a3791db33f1a7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/314501
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40503}
This commit is contained in:
Danil Chapovalov 2023-08-02 11:28:58 +02:00 committed by WebRTC LUCI CQ
parent 55b89a8068
commit 50ca701e68

View File

@ -657,7 +657,15 @@ void RtpPayloadParams::Vp9ToGeneric(const CodecSpecificInfoVP9& vp9_info,
result.chain_diffs[sid] = 0;
continue;
}
result.chain_diffs[sid] = shared_frame_id - chain_last_frame_id_[sid];
int64_t chain_diff = shared_frame_id - chain_last_frame_id_[sid];
if (chain_diff >= 256) {
RTC_LOG(LS_ERROR)
<< "Too many frames since last VP9 T0 frame for spatial layer #"
<< sid << " at frame#" << shared_frame_id;
chain_last_frame_id_[sid] = -1;
chain_diff = 0;
}
result.chain_diffs[sid] = chain_diff;
}
if (temporal_index == 0) {