Skip to content

Commit

Permalink
Fix SimulcastConsumer fails to switch spatial layers (#990)
Browse files Browse the repository at this point in the history
In that case the consumer video was frozen.
  • Loading branch information
satoren committed Jan 28, 2023
1 parent bfaf883 commit aa9645a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions worker/src/RTC/SimulcastConsumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,12 +685,13 @@ 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)
if (
// clang-format off
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.
Expand Down

0 comments on commit aa9645a

Please sign in to comment.