fix: Fix memory leak in DASH live streams with inband EventStream#3957
Merged
joeyparrish merged 1 commit intoshaka-project:masterfrom Feb 16, 2022
joeyparrish:region-leak-2
Merged
fix: Fix memory leak in DASH live streams with inband EventStream#3957joeyparrish merged 1 commit intoshaka-project:masterfrom joeyparrish:region-leak-2
joeyparrish merged 1 commit intoshaka-project:masterfrom
joeyparrish:region-leak-2
Conversation
Member
Author
|
Hrm... I've got a test failure, likely caused by the code I moved in DashParser. I'll take a look on Wednesday. |
joeyparrish
commented
Feb 16, 2022
| const source = [ | ||
| '<MPD minBufferTime="PT75S" type="dynamic">', | ||
| '<MPD minBufferTime="PT75S" type="dynamic"', | ||
| ' availabilityStartTime="1970-01-01T00:00:00Z">', |
Member
Author
There was a problem hiding this comment.
This test was broken before. You can't have a dynamic manifest without a start time. However, the code in DashParser hid this mistake, because it didn't set the PresentationTimeline to dynamic until after all the periods had been parsed.
I moved up the code that sets properties on PresentationTimeline, so that the correct values for start time and isLive() are available during parsing. That caused this test to fail, however, due to a failed assertion in PresentationTimeline. Making the MPD in this test more realistic fixes that previously-hidden issue.
EventStreams in DASH generate TimelineRegionInfo objects, which are then stored in the RegionTimeline and RegionObserver classes. But DashParser would add all regions to RegionTimeline, even if they would be quickly removed again, and RegionObserver would cache some regions from the timeline without ever removing them. This fixes the issue from both of those directions. DashParser will now ignore regions that are outside the DVR window (and therefore would soon be removed from RegionTimeline), and RegionObserver listens to an event on RegionTimeline to clean up its own storage when regions fall outside the DVR window during playback. Closes #3949 (memory leak in DASH live streams with inband EventStream)
theodab
approved these changes
Feb 16, 2022
joeyparrish
added a commit
that referenced
this pull request
Feb 16, 2022
) EventStreams in DASH generate TimelineRegionInfo objects, which are then stored in the RegionTimeline and RegionObserver classes. But DashParser would add all regions to RegionTimeline, even if they would be quickly removed again, and RegionObserver would cache some regions from the timeline without ever removing them. This fixes the issue from both of those directions. DashParser will now ignore regions that are outside the DVR window (and therefore would soon be removed from RegionTimeline), and RegionObserver listens to an event on RegionTimeline to clean up its own storage when regions fall outside the DVR window during playback. Closes #3949 (memory leak in DASH live streams with inband EventStream)
joeyparrish
added a commit
that referenced
this pull request
Feb 16, 2022
) EventStreams in DASH generate TimelineRegionInfo objects, which are then stored in the RegionTimeline and RegionObserver classes. But DashParser would add all regions to RegionTimeline, even if they would be quickly removed again, and RegionObserver would cache some regions from the timeline without ever removing them. This fixes the issue from both of those directions. DashParser will now ignore regions that are outside the DVR window (and therefore would soon be removed from RegionTimeline), and RegionObserver listens to an event on RegionTimeline to clean up its own storage when regions fall outside the DVR window during playback. Closes #3949 (memory leak in DASH live streams with inband EventStream)
joeyparrish
added a commit
that referenced
this pull request
Feb 16, 2022
) EventStreams in DASH generate TimelineRegionInfo objects, which are then stored in the RegionTimeline and RegionObserver classes. But DashParser would add all regions to RegionTimeline, even if they would be quickly removed again, and RegionObserver would cache some regions from the timeline without ever removing them. This fixes the issue from both of those directions. DashParser will now ignore regions that are outside the DVR window (and therefore would soon be removed from RegionTimeline), and RegionObserver listens to an event on RegionTimeline to clean up its own storage when regions fall outside the DVR window during playback. Closes #3949 (memory leak in DASH live streams with inband EventStream)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
EventStreams in DASH generate TimelineRegionInfo objects, which are
then stored in the RegionTimeline and RegionObserver classes. But
DashParser would add all regions to RegionTimeline, even if they would
be quickly removed again, and RegionObserver would cache some regions
from the timeline without ever removing them.
This fixes the issue from both of those directions. DashParser will
now ignore regions that are outside the DVR window (and therefore
would soon be removed from RegionTimeline), and RegionObserver listens
to an event on RegionTimeline to clean up its own storage when regions
fall outside the DVR window during playback.
Closes #3949 (memory leak in DASH live streams with inband EventStream)