Skip to content

Conversation

@PascalThuet
Copy link

Summary

Fixes #4945

  • Add segments.length > 0 guard to the DVR segment cleanup loop condition in MssFragmentMoofProcessor
  • Add early break after splice() when the segments array becomes empty
  • Guard the DVR range update after the loop with a length check on segments

Without this fix, a TypeError: Cannot read properties of undefined (reading 't') crash occurs when all segments fall before availabilityStartTime in live MSS streams with timeShiftBufferDepth.

Test plan

  • Play a live MSS stream with short timeShiftBufferDepth and verify no crash on segment cleanup
  • Pause playback longer than timeShiftBufferDepth, resume, and verify graceful handling
  • Run existing unit tests

🤖 Generated with Claude Code

The while loop that removes segments prior to the DVR availability start
time did not check if the segments array became empty after each splice.
When all segments fall before availabilityStartTime, the array is fully
emptied and accessing segments[0] throws a TypeError.

Add array length checks both in the loop condition and after the loop
before accessing segments[0] for the DVR range update.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@dsilhavy dsilhavy added this to the 5.2.0 milestone Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

MssFragmentMoofProcessor: crash when all DVR segments are removed in live MSS streams

2 participants