-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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: Fix memory leak in DASH live streams with inband EventStream #3957
Conversation
Hrm... I've got a test failure, likely caused by the code I moved in DashParser. I'll take a look on Wednesday. |
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.
Actual code LGTM.
@@ -985,7 +985,8 @@ describe('DashParser Manifest', () => { | |||
|
|||
it('duplicate Representation ids with live', async () => { | |||
const source = [ | |||
'<MPD minBufferTime="PT75S" type="dynamic">', | |||
'<MPD minBufferTime="PT75S" type="dynamic"', | |||
' availabilityStartTime="1970-01-01T00:00:00Z">', |
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.
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)
) 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)
) 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)
) 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)
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)