Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(DASH): decrease memory preasure on manifest with SegmentReference by updating old initSegmentReference #6499

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Bonnier Broadcasting <*@bonnierbroadcasting.com>
Bryan Huh <bhh1988@gmail.com>
Charter Communications Inc <*@charter.com>
Code It <*@code-it.fr>
Cristian Atehortua <cristian25a32@gmail.com>
Damien Deis <developer.deis@gmail.com>
Dany L'Hébreux <danylhebreux@gmail.com>
Dave Nicholas <davenicholasuk@gmail.com>
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Casey Occhialini <casey.occhialini@gmail.com>
Chad Assareh <assareh@google.com>
Chris Fillmore <fillmore.chris@gmail.com>
Costel Madalin Grecu <madalin.grecu@adswizz.com>
Cristian Atehortua <cristian25a32@gmail.com>
Damien Deis <developer.deis@gmail.com>
Dany L'Hébreux <danylhebreux@gmail.com>
Dave Nicholas <davenicholasuk@gmail.com>
Expand Down
20 changes: 19 additions & 1 deletion lib/dash/segment_template.js
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ shaka.dash.TimelineSegmentIndex = class extends shaka.media.SegmentIndex {
*/
appendTemplateInfo(info, periodStart, periodEnd, shouldFit,
initSegmentReference) {
this.initSegmentReference_ = initSegmentReference;
this.updateInitSegmentReference(initSegmentReference);
if (!this.templateInfo_) {
this.templateInfo_ = info;
this.periodStart_ = periodStart;
Expand Down Expand Up @@ -732,6 +732,24 @@ shaka.dash.TimelineSegmentIndex = class extends shaka.media.SegmentIndex {
}
}

/**
* Updates the init segment reference and propagates the update to all
* references.
* @param {shaka.media.InitSegmentReference} initSegmentReference
*/
updateInitSegmentReference(initSegmentReference) {
if (this.initSegmentReference_ === initSegmentReference) {
return;
}

this.initSegmentReference_ = initSegmentReference;
for (const reference of this.references) {
if (reference) {
reference.updateInitSegmentReference(initSegmentReference);
}
}
}

/**
*
* @param {number} time
Expand Down
12 changes: 12 additions & 0 deletions lib/media/segment_reference.js
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,18 @@ shaka.media.SegmentReference = class {
getSegmentData() {
return this.segmentData;
}

/**
* Updates the init segment reference and propagates the update to all partial
* references.
* @param {shaka.media.InitSegmentReference} initSegmentReference
*/
updateInitSegmentReference(initSegmentReference) {
this.initSegmentReference = initSegmentReference;
for (const partialReference of this.partialReferences) {
partialReference.updateInitSegmentReference(initSegmentReference);
}
}
};


Expand Down
Loading