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}
This commit is contained in:
Ilya Nikolaevskiy
2020-09-22 15:55:23 +02:00
committed by Commit Bot
parent ceb44959ca
commit a945cdadff
2 changed files with 44 additions and 2 deletions

View File

@ -210,7 +210,7 @@ VideoCodec VideoCodecInitializer::VideoEncoderConfigToVideoCodec(
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;