-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix SimulcastConsumer fails to switch spatial layers #993
Conversation
Is it still a draft PR? or can we review it already? |
It's already late in my time zone, so tomorrow |
I believe the one below is a more concise and less error prone fix: This way we are avoiding the buggy scenario by only setting the Before this change we would set those flags for a non keyframe packet (even if it belonged to a target spatial layer) so the flags would remain set and the packet would be dropped. This solution is more consistent and robust. Nice catch @satoren! diff --git a/worker/src/RTC/SimulcastConsumer.cpp b/worker/src/RTC/SimulcastConsumer.cpp
index 100f86c8d..70bd13012 100644
--- a/worker/src/RTC/SimulcastConsumer.cpp
+++ b/worker/src/RTC/SimulcastConsumer.cpp
@@ -660,12 +660,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. |
@satoren, could you please try it whenever suits you? |
a60535f
to
aa9645a
Compare
In that case the consumer video was frozen.
@jmillan Thank you. Seems to be working fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guys I'm looking at the changes and rationale and I don't understand which behavior changes here or how it fixes the problem. I'm not saying it's wrong. May you please explain the scenario those changes fix?
It's explained here |
Definitely my patch is totally a placebo. It changes nothing.., it just move a condition up to the parent conditional statement. What was I thinking about... |
Let' see: Scenario 1 (non keyframe received)
In v3:
In this PR:
So no changes in Scenario 1 between v3 and this PR. Scenario 2 (keyframe received)
In v3:
In this PR:
So no changes in Scenario 2 between v3 and this PR. Scenario 3 (non keyframe received II)
In v3:
In this PR:
So no changes in Scenario 3 between v3 and this PR. ConclusionUnless I miss some scenario, I don't see how changes in this PR can change anything. |
Let's close this PR since, as proven above, it cannot fix anything. Alternative PR here #999 |
Fix #990
#990 (comment)
It appears #825 was not fully fixed.