-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: Destroy correctly unused transmuxer #7059
Conversation
914bff7
to
e7aac37
Compare
Incremental code coverage: 62.50% |
e7aac37
to
d7a12a5
Compare
this.transmuxers_[contentType] = transmuxer; | ||
} else if (transmuxer) { | ||
// Compare if the transmuxer is different | ||
if (this.transmuxers_[contentType] && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whenever codecSwitchIfNecessary_
detects that a transmuxer is needed, it creates a new instance of the desired transmuxer. It never recycles the old transmuxer. So doesn't that mean that this is always going to delete the old transmuxer?
I was going to say that we should be comparing the respective shaka.extern.TransmuxerPlugin
to see if the two transmuxers are of the same type, instead of seeing if they are the same object. However, looking at the transmuxers we have now, none of them look to be stateless. Most of them have internal variables like frameIndex_
which maybe we do want to reset by remaking the transmuxer.
If that is the case, and we never want to keep the old transmuxer, this whole segment could be greatly simplified.
if (this.transmuxers_[contentType]) {
this.transmuxers_[contentType].destroy();
delete this.transmuxers_[contentType];
}
if (transmuxer) {
this.transmuxers_[contentType] = transmuxer;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes we want to keep the transmuxer, because then we don't have to generate the initialization segment again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, also I see now that this isn't comparing the transmuxers themselves, it's comparing their transmux
methods. I guess that works as a way to ensure they came from the same plugin.
this.transmuxers_[contentType] = transmuxer; | ||
} else if (transmuxer) { | ||
// Compare if the transmuxer is different | ||
if (this.transmuxers_[contentType] && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, also I see now that this isn't comparing the transmuxers themselves, it's comparing their transmux
methods. I guess that works as a way to ensure they came from the same plugin.
🤖 I have created a release *beep* *boop* --- ## [4.10.7](v4.10.6...v4.10.7) (2024-07-18) ### Bug Fixes * Allow reference mimeType change in StreamingEngine ([#7061](#7061)) ([2fe4dcc](2fe4dcc)) * **DASH:** Prioritize highest bandwidth in PeriodCombiner ([#7045](#7045)) ([30cdd61](30cdd61)) * Destroy correctly unused transmuxer ([#7059](#7059)) ([7641475](7641475)) * Fix MSE polyfill for iOS ([#7049](#7049)) ([44dc9a9](44dc9a9)) * **HLS:** Remove init segment on formats without init segment ([#7060](#7060)) ([ee179ad](ee179ad)) * **Transmuxer:** Fix init segment between discontinuities ([#7042](#7042)) ([dd2a6d7](dd2a6d7)) * **ttml:** Handle escaped special characters. ([#7047](#7047)) ([451a41e](451a41e)), closes [#7044](#7044) * **UI:** Fix resolution label when the stream has not resolution ([#7043](#7043)) ([9e468f4](9e468f4)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
No description provided.