Make VP9 correctly accept middle-layer singlecast
Unfortunate typo and weak tests made it so if only a middle spatial layer
is active, vp9 encoder would be configured to send two top layers.
Bug: webrtc:11319
Change-Id: I460c245044f60ea7e0127c0e4134d0edab85f4f3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185043
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32164}
diff --git a/modules/video_coding/video_codec_initializer.cc b/modules/video_coding/video_codec_initializer.cc
index 777056f..36401ff 100644
--- a/modules/video_coding/video_codec_initializer.cc
+++ b/modules/video_coding/video_codec_initializer.cc
@@ -210,7 +210,7 @@
for (size_t spatial_idx = first_active_layer;
spatial_idx < config.simulcast_layers.size() &&
- spatial_idx < spatial_layers.size();
+ spatial_idx < spatial_layers.size() + first_active_layer;
++spatial_idx) {
spatial_layers[spatial_idx - first_active_layer].active =
config.simulcast_layers[spatial_idx].active;