diff --git a/worker/src/RTC/SimulcastConsumer.cpp b/worker/src/RTC/SimulcastConsumer.cpp index 59b63ebcf9..05554ab335 100644 --- a/worker/src/RTC/SimulcastConsumer.cpp +++ b/worker/src/RTC/SimulcastConsumer.cpp @@ -685,12 +685,14 @@ namespace RTC // Check whether this is the packet we are waiting for in order to update // the current spatial layer. - if (this->currentSpatialLayer != this->targetSpatialLayer && spatialLayer == this->targetSpatialLayer) + // clang-format off + if ( + this->currentSpatialLayer != this->targetSpatialLayer && + spatialLayer == this->targetSpatialLayer && + packet->IsKeyFrame() + ) + // clang-format on { - // Ignore if not a key frame. - if (!packet->IsKeyFrame()) - return; - shouldSwitchCurrentSpatialLayer = true; // Need to resync the stream.