Skip to content

Commit

Permalink
fix(ReceiveVideoController) fix setting lastN to 0
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
saghul authored and jallamsetty1 committed Aug 15, 2024
1 parent 03f7d88 commit 134aac1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/qualitycontrol/ReceiveVideoController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 134aac1

Please sign in to comment.