From 1dea1ea412021819bddbc9400dcca7d9dd2eba74 Mon Sep 17 00:00:00 2001 From: Ilya Nikolaevskiy Date: Fri, 21 Feb 2020 12:05:28 +0100 Subject: [PATCH] [VP9 encoder] Set temporal id also on disabled spatial layers Bug: chromium:1051476 Change-Id: Iaf2b6ab6640cd314a620dbdf1547d8f1b2f40693 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168921 Reviewed-by: Evan Shrubsole Commit-Queue: Ilya Nikolaevskiy Cr-Commit-Position: refs/heads/master@{#30581} --- modules/video_coding/codecs/vp9/vp9_impl.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/video_coding/codecs/vp9/vp9_impl.cc b/modules/video_coding/codecs/vp9/vp9_impl.cc index fe6c912917..72b1521b84 100644 --- a/modules/video_coding/codecs/vp9/vp9_impl.cc +++ b/modules/video_coding/codecs/vp9/vp9_impl.cc @@ -917,7 +917,10 @@ int VP9EncoderImpl::Encode(const VideoFrame& input_image, } } - for (int sl_idx = 0; sl_idx < num_active_spatial_layers_; ++sl_idx) { + // Need to set temporal layer id on ALL layers, even disabled ones. + // Otherwise libvpx might produce frames on a disabled layer: + // http://crbug.com/1051476 + for (int sl_idx = 0; sl_idx < num_spatial_layers_; ++sl_idx) { layer_id.temporal_layer_id_per_spatial[sl_idx] = layer_id.temporal_layer_id; }