http-streaming icon indicating copy to clipboard operation
http-streaming copied to clipboard

Bug: Memory leak in Timed Metadata TextTrack cues

Open pmendozav opened this issue 3 months ago • 0 comments

In the PlaylistController class, when creating mainSegmentLoader_, the constructor receives the inbandTextTracks_ instance from the controller:

    const segmentLoaderSettings = {
      // ...
      inbandTextTracks: this.inbandTextTracks_,
      // ...
    };

    this.mainSegmentLoader_ =
      new SegmentLoader(merge(segmentLoaderSettings, {

The SegmentLoader class has a remove method that cleans inbandTextTracks_ and controls its size. However, PlaylistController.inbandTextTracks_ never clears its content. In fact, we can verify that the references to inbandTextTracks_ in PlaylistController and SegmentLoader are not the same using:

player.tech_.vhs.playlistController_.mainSegmentLoader_.inbandTextTracks_ === player.tech_.vhs.playlistController_.inbandTextTracks_

As a result, player.tech_.vhs.playlistController_.inbandTextTracks_.metadataTrack_.cues_ grows indefinitely.

Image

Steps to reproduce:

Unfortunately, I cannot share the live stream URL. However, it can be verified that the references of inbandTextTracks_ in PlaylistController and SegmentLoader are not the same with any URL on Netlify.

pmendozav avatar Sep 30 '25 04:09 pmendozav