From 21b1bf9b4e4f1edf3927eb2d01798de0270477e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Baz=20Castillo?= Date: Tue, 31 Jan 2023 11:14:17 +0100 Subject: [PATCH] SimulcastConsumer: Fix frozen video when syncing keyframe is discarded due to too high RTP timestamp extra offset needed (#999) - Fixes #990. - Rationale here: https://github.com/versatica/mediasoup/issues/990#issuecomment-1409997273. - Basically we should reset this->syncRequired` nor `this->spatialLayerToSync` when the keyframe that is supposed to switch to another spatial layer is discarded due to too high RTP timestamp extra offset needed. --- CHANGELOG.md | 1 + worker/src/RTC/SimulcastConsumer.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8aa647959f..b83b8a47a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### NEXT * `SimulcastConsumer::GetDesiredBitrate()`: Choose the highest bitrate among all Producer streams ([PR #992](https://github.com/versatica/mediasoup/pull/992)). +* `SimulcastConsumer`: Fix frozen video when syncing keyframe is discarded due to too high RTP timestamp extra offset needed ([PR #999](https://github.com/versatica/mediasoup/pull/999)). * Update NPM deps. diff --git a/worker/src/RTC/SimulcastConsumer.cpp b/worker/src/RTC/SimulcastConsumer.cpp index ef2e26e253..a129555bb9 100644 --- a/worker/src/RTC/SimulcastConsumer.cpp +++ b/worker/src/RTC/SimulcastConsumer.cpp @@ -809,6 +809,10 @@ namespace RTC this->keyFrameForTsOffsetRequested = true; + // Reset flags since we are discarding this key frame. + this->syncRequired = false; + this->spatialLayerToSync = -1; + return; }