Skip to content

Commit

Permalink
Merge pull request #166 from hwx350758/master
Browse files Browse the repository at this point in the history
Modify null pointer in Cam.js
  • Loading branch information
agsh committed Jun 10, 2020
2 parents e2ab59e + d807b48 commit eae4680
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions lib/cam.js
Original file line number Diff line number Diff line change
Expand Up @@ -658,13 +658,16 @@ Cam.prototype.getActiveSources = function() {

this.activeSources[idx] = {
sourceToken: videoSource.$.token
, profileToken: this.defaultProfiles[idx].$.token
, encoding: this.defaultProfiles[idx].videoEncoderConfiguration.encoding
, width: this.defaultProfiles[idx].videoEncoderConfiguration.resolution.width
, height: this.defaultProfiles[idx].videoEncoderConfiguration.resolution.height
, fps: this.defaultProfiles[idx].videoEncoderConfiguration.rateControl.frameLimit
, bitrate: this.defaultProfiles[idx].videoEncoderConfiguration.rateControl.bitrateLimit
, profileToken: this.defaultProfiles[idx].$.token
};
if (this.defaultProfiles[idx].videoEncoderConfiguration) {
var configuration = this.defaultProfiles[idx].videoEncoderConfiguration;
this.activeSources[idx].encoding = configuration.encoding;
this.activeSources[idx].width = configuration.resolution ? configuration.resolution.width : "";
this.activeSources[idx].height = configuration.resolution ? configuration.resolution.height : "";
this.activeSources[idx].fps = configuration.rateControl ? configuration.rateControl.frameLimit : "";
this.activeSources[idx].bitrate = configuration.rateControl ? configuration.rateControl.bitrateLimit : "";
}

if (idx === 0) {
/**
Expand Down

0 comments on commit eae4680

Please sign in to comment.