From 134aac16fdb757b35449792260f0214bff05d3ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Thu, 15 Aug 2024 12:01:55 +0200 Subject: [PATCH] fix(ReceiveVideoController) fix setting lastN to 0 When lastN is first set to some truty value and then 0, it wouldn't be set because we relied on a "truthyness" check. Check if the value is undefined so it can be set to 0. --- modules/qualitycontrol/ReceiveVideoController.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/qualitycontrol/ReceiveVideoController.js b/modules/qualitycontrol/ReceiveVideoController.js index cc21d2e5a4..9a78fa8826 100644 --- a/modules/qualitycontrol/ReceiveVideoController.js +++ b/modules/qualitycontrol/ReceiveVideoController.js @@ -213,7 +213,8 @@ export default class ReceiveVideoController { this._receiverVideoConstraints = constraints; this._assumedBandwidthBps = constraints.assumedBandwidthBps ?? this._assumedBandwidthBps; - this._lastN = constraints.lastN && !this._lastNLimitedByCpu ? constraints.lastN : this._lastN; + this._lastN = typeof constraints.lastN !== 'undefined' && !this._lastNLimitedByCpu + ? constraints.lastN : this._lastN; this._receiverVideoConstraints.lastN = this._lastN; this._receiveResolutionLimitedByCpu && this._updateIndividualConstraints();