Skip to content

Commit

Permalink
Fix/throughput rule (#4450)
Browse files Browse the repository at this point in the history
* Fix a bug that causes period ID to be set to default when the ID is parsed as a date.

* Account for null representation in ThroughputRule.js
  • Loading branch information
dsilhavy committed Apr 11, 2024
1 parent 8435c78 commit c5e4687
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/dash/models/DashManifestModel.js
Expand Up @@ -892,8 +892,8 @@ function DashManifestModel() {

let id = Period.DEFAULT_ID + '_' + i;

if (realPeriod.hasOwnProperty(DashConstants.ID) && realPeriod.id.length > 0 && realPeriod.id !== '__proto__') {
id = realPeriod.id;
if (realPeriod.hasOwnProperty(DashConstants.ID) && realPeriod.id.toString().length > 0 && realPeriod.id !== '__proto__') {
id = realPeriod.id.toString();
}

return id;
Expand Down
2 changes: 1 addition & 1 deletion src/streaming/rules/abr/ThroughputRule.js
Expand Up @@ -72,7 +72,7 @@ function ThroughputRule(config) {
switchRequest.reason = {
throughput,
latency,
message: `[ThroughputRule]: Switching to Representation with bitrate ${switchRequest.representation.bitrateInKbit} kbit/s. Throughput: ${throughput}`
message:`[ThroughputRule]: Switching to Representation with bitrate ${switchRequest.representation ? switchRequest.representation.bitrateInKbit : 'n/a'} kbit/s. Throughput: ${throughput}`
};
scheduleController.setTimeToLoadDelay(0);
}
Expand Down

0 comments on commit c5e4687

Please sign in to comment.